Skip to content

Uncaught TypeError: Cannot read property 'focus' of null #44

@c-emil

Description

@c-emil

Hi, there's a problem with calling focus on element that doesn't exists anymore.

The Uncaught TypeError is triggered on this line: https://github.com/selvagsz/react-power-select/blob/master/src/Select.js#L156

The source of the problem is that powerselect element no longer exist but it tries to call the focus method on it. I think the setTimeout should be assigned to an instance variable and once the Select component is about to be destroyed, this timeout should be cleared out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions