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

Cannot use input widgets whilst listening to keyboard events #57

Open
agoose77 opened this issue Sep 16, 2020 · 1 comment
Open

Cannot use input widgets whilst listening to keyboard events #57

agoose77 opened this issue Sep 16, 2020 · 1 comment

Comments

@agoose77
Copy link

This might only apply to the FloatText/IntText, but I assume it might be a broader issue.

By calling preventDefault on the widget, we lose the ability to enter values into widgets.

ipyevents/src/events.ts

Lines 268 to 269 in b6a94c7

event.stopPropagation()
event.preventDefault()

Perhaps a solution here would be to enable a list of keycodes that are either ignored, or always blocked. I was thinking otherwise the Python event handler could veto the blocking, but that would add the roundtrip time to each event 🤮

@mwcraig
Copy link
Owner

mwcraig commented Jul 8, 2021

I'm not quite sure what to do about this. The original motivation for this was to make sure that handlers for keyboard events didn't have to worry about colliding with the default notebook keyboard shortcuts (I had particular issues with d``d colliding with a handler I was working on.

Is your case that the text widget is the one whose events you are watching or is it that a text widget is inside some other, larger, widget that you are handling events for?

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

No branches or pull requests

2 participants