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

Hide bottom space for error message when validation is None #3660

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

falkoschindler
Copy link
Contributor

PR #3446 added a bottom space for the error message of validation messages. This turned out to be unnecessary when no validation is used. This PR changes the behavior to only reserve the bottom space if the validation property is not None.

Code for experimenting with the new implementation:

input_ = ui.input(value='Hello, world!').classes('border')

def add_validation():
    input_.validation = {
        'Must start with "Hello"': lambda x: x.startswith('Hello'),
        'Must end with "world!"': lambda x: x.endswith('world!')
    }

def remove_validation():
    input_.validation = None

ui.button('Add validation', on_click=add_validation)
ui.button('Remove validation', on_click=remove_validation)

@falkoschindler falkoschindler added the enhancement New feature or request label Aug 31, 2024
@falkoschindler falkoschindler added this to the 2.0.0 milestone Aug 31, 2024
@rodja rodja merged commit 5c1139b into main Aug 31, 2024
6 checks passed
@rodja rodja deleted the input-validation branch August 31, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants