Quasar props can not contain spaces
See original GitHub issueDiscussed in https://github.com/zauberzeug/nicegui/discussions/97
<div type='discussions-op-text'>Originally posted by gbrandt September 27, 2022 I am using ui.input() and it allows a prop called ‘error-message’.
self.input_add_user_email = ui.input(label='Email', on_change=self.on_change_email).props('error-message=Invalid Email').style('width: 300px')
However only the text Invalid
is shown on the error when I do this: self.button_add_user.props('disable=false')
Is there anyway to get a string with spaces into the error message?</div>
This is indeed a limitation of our current simple property parsing: https://github.com/zauberzeug/nicegui/blob/f417d7a64b43f00e52dd843445a8a9d8b9b366b9/nicegui/elements/element.py#L93
Task List:
- write integration test (skip execution until issue is fixed)
- unit-test
str_to_dict
function which is used byelement.props
- allow multi-word values in props
- enable integration test if everything is running
- review
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
QSpace - Quasar Framework
The purpose of QSpace (has no props) is to simply fill all available space inside of a flexbox DOM element. As a sidenote,...
Read more >white-space: pre-wrap doesn't work while passing text as a ...
I am just passing a long-text as a prop into a child component in Vue project. child component ...
Read more >Quasar's QTable: The ULTIMATE Component (2/6)
I use selectable rows, and expandable rows all the time! I'll give you a real world example. We record "spraying events" for paddocks, ......
Read more >Vuelidate | A Vue.js model validation library
This is especially useful if you are using data from external source, like Vuex store or props. In that case you have to...
Read more >Available rules - eslint-plugin-vue
Rule ID Description
vue/multi‑word‑component‑names require component names to be always multi‑word...
vue/no‑arrow‑functions‑in‑watch disallow using arrow functions to define watcher...
vue/no‑computed‑properties‑in‑data disallow accessing computed properties in data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Inspired by the gist I came up with quite simple parsers for props, styles and classes:
Each lexer defines
whitespace
that separates consecutive key-value blocks.wordchars
are letters, numbers and “_” by default. We the key-value separator and other allows characters like “-”. Note that everything in quotes is allowed anyway, like the “&” in the props example. The last step is to process the lexing result: Props are automatically true if not value is given; and we strip whitespace from style keys and values.These functions could replace
str_to_dict
.And the lexers could even be instantiated once and reused if performance is an issue.Bugfix release in 0.9.11