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
maartenbreddels
left a comment
There was a problem hiding this comment.
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). |
maartenbreddels
left a comment
There was a problem hiding this comment.
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 InputTextupdate_events on InputText
|
I think this is very useful for #341 as well, such that we can bind to shift-enter |

Previously
on_valuewould be triggered whenever enter was pressed orInputTextlost focus. With this PR we would allow people to modify these events.