WeakAuras

WeakAuras

206M Downloads

Allow Custom Option Type: Number to have an empty / nil default value

NaR00W opened this issue ยท 2 comments

commented

Is your feature request related to a problem? Please describe.
"Optional" numeric fields appear filled in visually since they have to be a numeric value, 0 for instance.
In the case of spell IDs it's quite operationally confusing that a dummy ignored value is different from the desired genuine values.
For instance having a default value of 0 and excluding that programmatically, while expecting actual values to have 3 to 6 digits.

I would like this to be possible: https://i.imgur.com/Mxc9tGz.png

I understand that "" or nil is not considered a number so it might violate some assertion put in that numeric fields should always return something of type == "number".

In case this doesn't break anything I think it would make numeric input fields look neater

commented

That was actually a conscious choice, removing the true parameter in

set = setNum(data, option, "default", true)
enables a nil value.

@emptyrivers any insight why you choose that? Nothing seems to break if I change that.

commented

I was actually wrong about that being a simple one-liner change, I did look a bit deeper in what would be required to allow that, and it's not easly doable. I also discussed that with rivers that wrote that code, and in conclusion it's not something we want to allow.