Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null reference error on closing dialog #391

Open
jded76 opened this issue Apr 18, 2020 · 0 comments
Open

null reference error on closing dialog #391

jded76 opened this issue Apr 18, 2020 · 0 comments

Comments

@jded76
Copy link

jded76 commented Apr 18, 2020

I get this error (only on Internet Explorer and only on some rare occasions):

TypeError: Unable to get property 'focus' of undefined or null reference
at restoreFocus (http://localhost:9001/vendors~a3fd09b7.01e2e1f28a3ef0d6c8d3.chunk.js:866:60)
at DialogRenderer.prototype.detach (http://localhost:9001/vendors.async~253ae210.01e2e1f28a3ef0d6c8d3.chunk.js:1693:13)
at Anonymous function (http://localhost:9001/vendors.async~253ae210.01e2e1f28a3ef0d6c8d3.chunk.js:1778:33)
at Anonymous function (http://localhost:9001/vendors~f9ca8911.01e2e1f28a3ef0d6c8d3.chunk.js:300:7)

We can avoid this by changing this line :

public restoreFocus = (lastActiveElement: HTMLElement) => lastActiveElement.focus();
to :
public restoreFocus = (lastActiveElement: HTMLElement) => { if (lastActiveElement) { lastActiveElement.focus(); } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant