-
-
Notifications
You must be signed in to change notification settings - Fork 691
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
Remove zero width space special case from public API #3136
Comments
I agree the The solution is effectively "keep a second authoritative source of state for the widget" - which I'm not wild about as a solution. Yes, it would work, but it's a complication that results in the potential for the widget a the value of the widget to get out of sync. That said - moving to ValueSource might provide a way to address this - this is effectively moves the source of truth canonically to the ValueSource, with the widget being asked to reflect that source of truth. |
The thing is, if I saw documentation like this, my first response would be "what the hell is that", and my second response would be "ah, it's an implementation detail that they've failed to encapsulate properly". That wouldn't make me confident in the quality of the library.
It can be much more limited than that – just a boolean flag which distinguishes between the values |
That's fair.
That doesn't sound too bad - if a fix for this doesn't fall out of the ValueSource changes, that sounds like a low-effort fix that would be worthwhile. |
Label, Switch and Button all document their
text
property as follows:The zero width space special case was added for the benefit of WinForms, where some of these widgets will collapse their height if you give them an actual empty string.
However, there's no need for this implementation detail to complicate the public API. We should follow the same principle as we have on other widgets such as Slider, where if a backend is unable to round-trip a value, then it sets the native value to the best possible approximation, and caches the “true” value so it can be returned to the interface layer unchanged.
The text was updated successfully, but these errors were encountered: