ui.input changes height when validation fails (version >= 1.4.11) #2484
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @akai-1024, I reproduced the problem with the following minimal example: with ui.row().classes('items-center'):
ui.input('Start', value='0', validation={'Required': bool})
ui.input('End', value='100', validation={'Required': bool}) But it also occurs with NiceGUI 1.4.10, so I'm not sure if the behavior really changed. It boils down to the question, why the size of the input element changes when an error occurs: ui.input(validation={'Required': bool}).classes('bg-blue-100') In contrast, a plain Quasar input is already initialized with enough height for the error message: <q-input :rules="[val => !!val || 'Required']" style="background-color: aliceblue"></q-input> |
Beta Was this translation helpful? Give feedback.
-
Hi, @falkoschindler Thanks for your reply. And I checked the element, the two input elements are slightly different. I hope it helps. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @akai-1024! I think we can fix it by adding self._props['error'] = False in As a workaround you can this line to immediately add the bottom space to your input: input._props['error'] = False |
Beta Was this translation helpful? Give feedback.
See PR #2492.