Safari delays the execution of the `blur` event on the document which causes the focus shift to happen too early.
Delaying it by two event cycles are enough to provide a consistent experience and to avoid conflicts with the focus trap.
See https://www.woltlab.com/community/thread/296069-best%C3%A4tigung-bei-installation-von-paket-%C3%BCber-entwickler-werkzeuge-nicht-direkt-pe/
* Sets the focus on the confirm button on dialog open for proper keyboard support.
*/
_onShow(): void {
- this.confirmButton.blur();
- this.confirmButton.focus();
+ window.setTimeout(() => {
+ this.confirmButton.blur();
+ this.confirmButton.focus();
+ }, 1);
}
_dialogSetup(): ReturnType<DialogCallbackSetup> {
* Sets the focus on the confirm button on dialog open for proper keyboard support.
*/
_onShow() {
- this.confirmButton.blur();
- this.confirmButton.focus();
+ window.setTimeout(() => {
+ this.confirmButton.blur();
+ this.confirmButton.focus();
+ }, 1);
}
_dialogSetup() {
return {