Replies: 1 comment 1 reply
-
Hi @bmrast, You could keep track of the input value and apply it when the focus gets lost: options = ['Apple', 'Banana', 'Cherry']
state: dict[str, str] = {}
ui.select(options=options, label='Choose a fruit', new_value_mode="add") \
.on('input-value', lambda e: state.update(value=e.args)) \
.on('blur', lambda e: e.sender.set_value(state['value'])) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hi,
I have an ui.select object that allows user to set new values:
This requires the user to type the new value and press enter. However, to me it happens often that I forget to press enter before clicking anywhere else or pressing tab and I loose the newly entered value. That is why I am wondering if there is any way to accept new values not only by pressing enter but also upon clicking anywhere else or pressing tab (to switch to the next field)?
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions