Replies: 2 comments 1 reply
-
Good point. I think it should be an error to set an The error is a side-effect of using the same code to parse selectors that parses the CSS. There should definitely be a more explicit error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I felt this was more of a question than an issue to raise to start with. Something I've noticed while playing with Textual the last week is that widgets can be built with IDs that aren't accepted by other parts of the library, especially stylesheets and performing queries. This can be shown with this little example:
I can create the
Button
with anid
of1-button
, but if I press it the app crashes inside the query:Is it a design choice to accept IDs in an "invalid" format but treat them as an error elsewhere, or more of an oversight at the moment and perhaps widgets should throw an exception if using an ID of a format Textual doesn't support?
Also, as a related question: is it a bit weird that the error is saying the problem is in the stylesheet when that mention of the problematic ID isn't in the stylesheet?
Beta Was this translation helpful? Give feedback.
All reactions