-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Run Plugin] Settings crashes if Numberbox is empty #32738
Comments
Note: I'm unable to hit a breakpoint under code as following: public void UpdateSettings(PowerLauncherPluginSettings settings)
{
_count = (int?)(settings?.AdditionalOptions?.FirstOrDefault(x => x.Key == Count)?.NumberValue) ?? 5;
} |
Okay this is strange.We set
|
Made a minimum example out.mp4 |
@8LWXpg And maybe a bugreport would help. |
I tested with following option, still has the same issue: public IEnumerable<PluginAdditionalOption> AdditionalOptions =>
[
new ()
{
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Numberbox,
Key = Setting,
DisplayLabel = "Test NumberBox",
NumberValue = 5,
NumberBoxMin = 2,
NumberBoxMax = 10,
},
]; |
@8LWXpg |
Works with numbers but not when the input box is empty. out.mp4 |
I did some tests and created a test app. The following is happening when clearing the number box and pressing enter:
This only happens if you clear the value. If the value resets because you type a number outside of min/max (e.g. 5000) everything is handled correctly. @Aaron-Junker , @niels9001
I think the best idea is to move the min/max validation into the Explanation what happens:If you clear the number box the value form the number box is empty as it is a normal text box with number features. That causes the view model variable to initialize with its default value (int) or beeing NaN (double). If the value of the view model variable is not between the minimum and maximum as defined in the NumberBox properties, the NumberBox shows the minimum or maximum value that is defined in XAML code instead of the view model variable value. |
This fix is included in the v0.81.0 release. |
Microsoft PowerToys version
0.80.1
Installation method
PowerToys auto-update, WinGet
Running as admin
Yes
Area(s) with issue?
PowerToys Run
Steps to reproduce
✔️ Expected Behavior
Fallback to default or
NumberBoxMin
.❌ Actual Behavior
Crash and exit.
Other Software
No response
The text was updated successfully, but these errors were encountered: