suspected bug with removing text input text color #3907
Replies: 2 comments
-
|
You can determine if the app is in dark mode with Regarding the specific use case - setting the text color red for validation - I wanted to confirm that you're aware that Toga has validation as a built-in feature. As for the specific approach you're taking - clearing the color attribute should restore to "default" colors. I think I'm seeing the same behavior as you, though. If I clear the text color attribute, the text color is set to |
Beta Was this translation helpful? Give feedback.
-
|
Bug report submitted. Thanks for the suggestion. Snippet at bottom seems to be a good workaround (at least on macOS, no extensive testing). I was aware of the validators but I initially ignored them because I did not want to port the validation logic which was already in the domain layer to the ui layer. However, I now realize that I can just do as below. lambda text: None if valid else "invalid" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I was looking for a way to indicate validation status on a text input. In the end I came up with the idea to temporarily change the text color to red for input that does not validate. See example below.
It generally works but not completely. The red text style works, but after the del I get white, black and white and black combinations of text in the input. However, I am not sure if this is the way I am supposed to restore the original text color. I cannot simply set it to white or black since I do not know the theme (dark/light). So I am posting this here instead of filing a bug report.
Beta Was this translation helpful? Give feedback.
All reactions