Skip to content

TextInput on_change and validators working together #2323

Answered by freakboy3742
cozimus asked this question in Q&A
Discussion options

You must be logged in to vote

That's an interesting problem. The evaluation of validation after the change signal isn't an explicitly intentional feature, but it is consistently implemented that way across all platforms (e.g., here's the macOS implementation - the same pattern is used on every backend.)

I agree that it would make sense for the "is valid" indicator to be correct when the change handler is invoked - you've identified at least one obvious use case; and I can't think of any use case that is made possible by the current behavior. I'll open a ticket for this feature request.

As an immediate workaround, you could invoke the validation logic as the first thing done by the on-change handler - (i.e., widget._va…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cozimus
Comment options

@freakboy3742
Comment options

@cozimus
Comment options

Answer selected by cozimus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants