Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ui.number after changing its limits #2753

Merged
merged 1 commit into from
Mar 23, 2024
Merged

Update ui.number after changing its limits #2753

merged 1 commit into from
Mar 23, 2024

Conversation

falkoschindler
Copy link
Contributor

This PR solves an issue noticed by @eddie3ruff on #2743: The stepper buttons of a ui.number element didn't enforce the min and max values after changing these limits. Consider the following example:

number = ui.number('Number', max=0, value=0)

def raise_max():
    number.max += 1

ui.button('Raise max', on_click=raise_max)

After raising the max, the stepper wouldn't allow changing the value, even though it could be edited via the input field. By triggering an update at the end of the min and max property setters, this problem is solved.

@falkoschindler falkoschindler added the bug Something isn't working label Mar 23, 2024
@falkoschindler falkoschindler added this to the 1.4.20 milestone Mar 23, 2024
@rodja rodja merged commit ee14497 into main Mar 23, 2024
7 checks passed
@rodja rodja deleted the number-limits branch March 23, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants