Comments about keydown vs keyup for Firefox
This commit is contained in:
parent
56a485bac6
commit
748aa5179f
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
@ -1691,6 +1691,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
|
|
||||||
// Bind keyboard shortcuts for a menu item
|
// Bind keyboard shortcuts for a menu item
|
||||||
|
// We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus
|
||||||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
|
||||||
bindMenuItemShortcuts: function bindMenuItemShortcuts(menuItem, type) {
|
bindMenuItemShortcuts: function bindMenuItemShortcuts(menuItem, type) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
@ -4884,6 +4886,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Settings menu - keyboard toggle
|
// Settings menu - keyboard toggle
|
||||||
|
// We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus
|
||||||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
|
||||||
this.bind(player.elements.buttons.settings, 'keyup', function (event) {
|
this.bind(player.elements.buttons.settings, 'keyup', function (event) {
|
||||||
// We only care about space and return
|
// We only care about space and return
|
||||||
if (event.which !== 32 && event.which !== 13) {
|
if (event.which !== 32 && event.which !== 13) {
|
||||||
|
2
dist/plyr.js.map
vendored
2
dist/plyr.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js.map
vendored
2
dist/plyr.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
src/js/controls.js
vendored
2
src/js/controls.js
vendored
@ -448,6 +448,8 @@ const controls = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Bind keyboard shortcuts for a menu item
|
// Bind keyboard shortcuts for a menu item
|
||||||
|
// We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus
|
||||||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
|
||||||
bindMenuItemShortcuts(menuItem, type) {
|
bindMenuItemShortcuts(menuItem, type) {
|
||||||
// Handle space or -> to open menu
|
// Handle space or -> to open menu
|
||||||
on(
|
on(
|
||||||
|
@ -6,7 +6,14 @@ import controls from './controls';
|
|||||||
import ui from './ui';
|
import ui from './ui';
|
||||||
import { repaint } from './utils/animation';
|
import { repaint } from './utils/animation';
|
||||||
import browser from './utils/browser';
|
import browser from './utils/browser';
|
||||||
import { getElement, getElements, hasClass, matches, toggleClass, toggleHidden } from './utils/elements';
|
import {
|
||||||
|
getElement,
|
||||||
|
getElements,
|
||||||
|
hasClass,
|
||||||
|
matches,
|
||||||
|
toggleClass,
|
||||||
|
toggleHidden,
|
||||||
|
} from './utils/elements';
|
||||||
import { on, once, toggleListener, triggerEvent } from './utils/events';
|
import { on, once, toggleListener, triggerEvent } from './utils/events';
|
||||||
import is from './utils/is';
|
import is from './utils/is';
|
||||||
|
|
||||||
@ -690,6 +697,8 @@ class Listeners {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Settings menu - keyboard toggle
|
// Settings menu - keyboard toggle
|
||||||
|
// We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus
|
||||||
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
|
||||||
this.bind(
|
this.bind(
|
||||||
player.elements.buttons.settings,
|
player.elements.buttons.settings,
|
||||||
'keyup',
|
'keyup',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user