-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat: allow any update_events
on InputText
#376
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Previously `on_value` would be triggered whenever enter was pressed or `InputText` lost focus. Now, when `enter_only = True`, losing focus will not trigger this.
5daf210
to
ca6bedd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have this feature, but I wonder if we should have a different API.
What about update_events=["blur", "keyup.enter"] as default arguments? This also allows a user to use "keyup.shift.enter" for instance.
@mariobuikhuizen ?
Sounds like a good idea. We could then also support an arbitrary number of events as triggers. We should then also properly document the bug that causes only one event of a type to be picked up (unless that was fixed and I've forgotten). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the overload anymore, and the docstring needs change.
Weird btw, that mypy didn't complain about the overload arguments not matching the function arguments.
372a3b0
to
95b5890
Compare
Should be fixed now |
95b5890
to
26e4e17
Compare
enter_only
option for InputText
update_events
on InputText
I think this is very useful for #341 as well, such that we can bind to shift-enter |
Previously
on_value
would be triggered whenever enter was pressed orInputText
lost focus. With this PR we would allow people to modify these events.