Skip to content

null reference error on closing dialog #391

@jded76

Description

@jded76

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(); } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions