Only focus button if menu wasn’t hidden already
This commit is contained in:
parent
c8db1e55dd
commit
aaa56caa9c
5
dist/plyr.js
vendored
5
dist/plyr.js
vendored
@ -2427,7 +2427,8 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
// True toggle by default
|
||||
var show = is.element(popup) && popup.hasAttribute('hidden');
|
||||
var hidden = popup.hasAttribute('hidden');
|
||||
var show = hidden;
|
||||
|
||||
if (is.boolean(input)) {
|
||||
show = input;
|
||||
@ -2468,7 +2469,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
setFocus.call(this, firstItem, true);
|
||||
}
|
||||
// If closing, re-focus the button
|
||||
else if (!show) {
|
||||
else if (!show && !hidden) {
|
||||
setFocus.call(this, button, is.keyboardEvent(input));
|
||||
}
|
||||
},
|
||||
|
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
vendored
2
dist/plyr.min.js
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
5
src/js/controls.js
vendored
5
src/js/controls.js
vendored
@ -1085,7 +1085,8 @@ const controls = {
|
||||
}
|
||||
|
||||
// True toggle by default
|
||||
let show = is.element(popup) && popup.hasAttribute('hidden');
|
||||
const hidden = popup.hasAttribute('hidden');
|
||||
let show = hidden;
|
||||
|
||||
if (is.boolean(input)) {
|
||||
show = input;
|
||||
@ -1124,7 +1125,7 @@ const controls = {
|
||||
setFocus.call(this, firstItem, true);
|
||||
}
|
||||
// If closing, re-focus the button
|
||||
else if (!show) {
|
||||
else if (!show && !hidden) {
|
||||
setFocus.call(this, button, is.keyboardEvent(input));
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user