Only focus button if menu wasn’t hidden already

This commit is contained in:
Sam Potts
2018-08-01 01:38:57 +10:00
parent c8db1e55dd
commit aaa56caa9c
5 changed files with 9 additions and 7 deletions

5
dist/plyr.js vendored
View File

@ -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));
}
},