[FIX] web: dialogs with shouldFocusButtons option have the focus set.

Before this fix, sometimes dialogs that had the option shouldFocusButtons set on open
did not set the focus on the buttons. This is especially true for the "discard changes"
dialog where it is less usable with the keyboard.

After this fix, we wait for the widget to append itself to the dom before setting the focus.
This commit is contained in:
Vincent Schippefilt
2018-09-26 16:18:41 +02:00
parent fe4c3e0064
commit 4f624b70fc
+3 -3
View File
@@ -182,10 +182,10 @@ var Dialog = Widget.extend({
self.$modal.removeAttr("aria-hidden");
self.$modal.modal('show');
self._opened.resolve();
if (options && options.shouldFocusButtons) {
self._onFocusControlButton();
}
});
if (options && options.shouldFocusButtons) {
self._onFocusControlButton();
}
return self;
},