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 Input Dialog to use Validator #1747

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

x24git
Copy link

@x24git x24git commented Apr 20, 2023

Currently, the Input Dialog accepts a Validator as a parameter but does not actually display anything via the UI. This PR fixes the following:

  • Add option for validate_while_typing to input_dialog and passes along to TextField.
  • Add a new has_any_validation_error filter that returns if any buffer in the application layout has a validation error.
  • Modify ValidationToolbar to accept a specific buffer object rather than just the currently focused buffer.
  • Modify the input_dialog object to validate when OK button is activated and prevent closing while validation errors exist.

@x24git
Copy link
Author

x24git commented Apr 21, 2023

Should Fix Issue #1715

)

# Extract buffer validation errors for buffer UIControl children classes
def get_buffer_from_content(content: UIControl) -> bool:
Copy link
Member

@jonathanslenders jonathanslenders Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename this? This doesn't return the buffer. For instance control_has_validation_error().
This PR looks good otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants