-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix vlite halts native keyboard events when using HTML input Elements #57
fix vlite halts native keyboard events when using HTML input Elements #57
Conversation
Got the same issue: unable to type text normally even vlite not in viewport. Wondering why there is no option to disable keyboard actions completely? Cuz I don't need them totally in my current projects, for example. |
@Jackky90 Adding an option is possible, but it concerns a fairly specific case. Normally this merge request corrects the problem. |
You have just unbind several tags, but that's not a pure solution. There can be any DOM node, listens to space key even a custom div. Also I've tried to create several players on the page and pressed down space -- result is the all players start playing simultaneously, that's not ok, this type of behavior breaks accessibility absolutely. There should be an option to disable key bindings plus, of course, player should listen keydown events only while focused, but not through the entire document. |
Have solved for myself by this 'hack' within onReady method
Also noticed player doesn't respect the option of disabling fullscreen mode -- it's just hiding the fs button, but still listen to dblclick event. The another dirty hack, I used is |
For editable DOM nodes, the current condition covers most cases imo. If there are other use case, an issue can be created. For the problem related to focus and accessibility, indeed it is a bug, can you open an issue? |
For both: key bindings and fs mode? |
|
What about adding two things:
|
Move keydown event to the player element Player has the focus on big play button click and on subtitle button click Remove keydown restriction on specific tags (#57) Limit keydown action when the player or children's player has the focus Replace querySelector by cached elements Add focus on first subtitle button when the subtitle menu is opened
The main problem is that the "focus" is attached to the document. If the "focus" were attached to each player element, there wouldn't be these conflicts with keyboard events fired outside of the player context. I started an accessibility optimization in #58. @Jackky90 It works well with several players on the same page and the accessibility is not broken. |
When vlitejs is implemented on a page where also input Elements are located you are unable to use these form inputs.
This is especially an issue when trying to type something for example inside a text input. You are not allowed to type spaces, move backwards or forwards in text and so on.
Quick Example:
https://jsfiddle.net/2b0uxmew/4/