mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #6496 from jellyfin-web/release-10.10.z
Skip prevented keyboard events
Original-merge: 5d8ab6a99b
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
08069a42d1
commit
e8f03f605a
2 changed files with 4 additions and 0 deletions
|
@ -1246,12 +1246,14 @@ export default function (view) {
|
|||
case 'ArrowLeft':
|
||||
case 'ArrowRight':
|
||||
if (!e.shiftKey) {
|
||||
e.preventDefault();
|
||||
showOsd(nowPlayingPositionSlider);
|
||||
nowPlayingPositionSlider.dispatchEvent(new KeyboardEvent(e.type, e));
|
||||
}
|
||||
return;
|
||||
case 'Enter':
|
||||
if (e.target.tagName !== 'BUTTON') {
|
||||
e.preventDefault();
|
||||
playbackManager.playPause(currentPlayer);
|
||||
showOsd(btnPlayPause);
|
||||
}
|
||||
|
|
|
@ -125,6 +125,8 @@ export function isInteractiveElement(element) {
|
|||
export function enable() {
|
||||
const hasMediaSession = 'mediaSession' in navigator;
|
||||
window.addEventListener('keydown', function (e) {
|
||||
if (e.defaultPrevented) return;
|
||||
|
||||
// Skip modified keys
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue