You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dialog closes without throwing a TypeError in IE (for dialog that was opened when there was no element with focus).
What is the current behavior?
I open a dialog by clicking an item in a drop down menu. This drop down menu is then closed immediately, which means that there is no element with focus. In dialog-container the element with focus is stored with:
* Adds an extra null check when restoring focus after a dialog is closed. This is necessary, because the `document.activeElement` can be null in IE.
* Switches the focusing logic to use the `Renderer`.
Fixesangular#2760.
Bug, feature request, or proposal:
Bug.
What is the expected behavior?
Dialog closes without throwing a TypeError in IE (for dialog that was opened when there was no element with focus).
What is the current behavior?
I open a dialog by clicking an item in a drop down menu. This drop down menu is then closed immediately, which means that there is no element with focus. In dialog-container the element with focus is stored with:
this._elementFocusedBeforeDialogWasOpened = document.activeElement;
The document.activeElement documentation states that:
I guess that both Chrome and Firefox set the
<body>
as active element, and IE sets it to null. Because only in IE I get the TypeError:TypeError: Unable to get property 'focus' of undefined or null reference
When the dialog is trying to re-focus the element with last focus after closing the dialog:
(this._elementFocusedBeforeDialogWasOpened as HTMLElement).focus();
What are the steps to reproduce?
In IE, open dialog without an element having focus, close dialog again.
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Affected browser: IE11.
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: