aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js')
-rw-r--r--src/js/controls.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 90a4560c..fa03a36d 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -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));
}
},