Fix focus loss caused by sliders affecting keyboard shortcuts (follow-up to #1650)#1694
Conversation
|
This pull request is deployed at test.editor.opencast.org/1694/2026-04-10_12-36-21/ . |
|
I can reproduce the issue you've described and this PR does fix it. However, I am not quite happy with the solution.
Do you think there might be another solution? Since the issue seems to lie with key events being caught by the sliders, maybe the sliders could let the key events they don't need propagate? E.g. keep behaviour for "<-" and "->", but let "Space" propagate to trigger the video play/pause? |
f4fa8d8 to
3f73aac
Compare
|
@Arnei, thanks for the review and for catching that! I've updated the implementation to use the
Please take another look. Since this touched the configuration for all hotkeys, a quick sanity test on the general hotkey behavior everywhere would be much appreciated! |
Arnei
left a comment
There was a problem hiding this comment.
This works and looks reasonable to me, thank you!
I've noticed some weird behaviour, where if you drag the zoom slider with the mouse, then click on the timeline, the "-->" and "<--" keys will move both the zoom slider and the scrubber. But that behaviour was already present previously, so it should not block this PR.
This PR is a follow-up/fix for the new keyboard shortcuts introduced in #1650.
The issue occurred because the sliders (zoom and volume) were taking focus during interaction and not returning it afterward to the main element. As a result, keyboard shortcuts stopped working once users adjusted those sliders.
Solution
This PR introduces a
MainFocusContextthat allows components to restore focus back to the main workspace after slider interaction completes.Specifically:
onChangeCommittedevents trigger restoring focus to the main workspaceMainFocusContextcan be used also in other places later on!Result
After adjusting zoom or volume sliders:
UPDATE
This PR had a revert on the above mentioned solution and now got newer changes: #1694 (comment)