Comments (8)
Note: I'm unable to hit a breakpoint under UpdateSettings
with the steps mentioned above. But once the Numberbox is set to any numeric value, I am able to reach the breakpoint as intended.
code as following:
public void UpdateSettings(PowerLauncherPluginSettings settings)
{
_count = (int?)(settings?.AdditionalOptions?.FirstOrDefault(x => x.Key == Count)?.NumberValue) ?? 5;
}
from powertoys.
Okay this is strange.We set NumberBoxMax
and NumberBoxMin
to double.Max
and double.Min
.
So theoretically it shouldn't accept the empty value.
- What plugin do you use that produces the crash?
- Can you please share a screen video?
from powertoys.
Made a minimum example
out.mp4
from powertoys.
@8LWXpg
The PluginAdditionalOptions
allow to define min and max values for the number box setting. Can you try if explicitly definig them fixes the bug? (If yes I think we have a problem with the is Null
check in the settings app code.)
And maybe a bugreport would help.
from powertoys.
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,
},
];
from powertoys.
@8LWXpg
Does the number box ignore the min and max settings? Because normally it should fallback to the min value.
from powertoys.
Works with numbers but not when the input box is empty.
out.mp4
from powertoys.
I did some tests and created a test app. The following is happening when clearing the number box and pressing enter:
For the input number boxes the Minimum
is set to 10
and the Maximum
is set to 50
.
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
It feels confusing that ...
- the shown value in the input NumberBox (with min/max set) is different form the real value in the ViewModel variable.
- the number box des not handle empty input correctly if bind against a
double
.
I think the best idea is to move the min/max validation into the ViewModel
and also add a NaN validation there. Thoughts and ideas?
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.
from powertoys.
Related Issues (20)
- Backup & Restore Location won't change HOT 2
- Paste files into new folder HOT 3
- PowerRename add shortcut and remember settings option HOT 1
- Power Toys seems to autopaste text to slack without user action HOT 2
- mouse utility feature (auto-hide) HOT 3
- Paste as Plain Text - Excel Bug HOT 4
- Awake Request HOT 1
- ColorColor Picker add lab method HOT 1
- 唤醒功能每日固定一个时间段保持唤醒
- [Mouse Utils] Allow Crosshairs center radius to be 0 px
- error HOT 3
- CommandNotFound crashes pwsh if DNS server is not found HOT 1
- Advanced paste "Paste as plain text" doesn't work with Right Alt, works only with Left Alt HOT 2
- Unexpected Behaviour HOT 3
- More languages for the text extractor HOT 1
- [CommandNotFound] - breaks powershell when internet is disconnected HOT 3
- Personalization Lockscreen
- While advanced paste is turned on, pasting into any application also pastes into slack while it's closed to system tray HOT 3
- Advanced paste with VPN split tunneling HOT 4
- Auto-hide mouse when crosshairs are enabled toggle option. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powertoys.