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

Cannot read properties of null (reading 'firstChild') #418

Open
VincentMolinie opened this issue Apr 11, 2024 · 3 comments
Open

Cannot read properties of null (reading 'firstChild') #418

VincentMolinie opened this issue Apr 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@VincentMolinie
Copy link

VincentMolinie commented Apr 11, 2024

I got this error that happens randomly in my tests, it happens when I open the emoji picker element.
It throws the error but the emoji picker still seems to work.
It might require a little defensive programming

I'm using emoji-picker-element 1.21.1.

Capture d’écran 2024-04-11 à 10 30 05

@nolanlawson
Copy link
Owner

The error seems to be coming from here:

range.selectNode(node.firstChild)

Can you test in the latest version (1.21.3)? Which browser are you using? Can you share your test code? Otherwise I don't have much context to figure out where the bug is coming from...

@nolanlawson
Copy link
Owner

Interesting – I can reproduce this, but only in desktop Safari 12.0. In Safari 13 it seems fixed.

Repro steps: just randomly click on the categories and type into the search bar.

Screenshot from 2024-06-16 16-34-18

It looks like effectively what's happening is that the .emoji-menu element being updated is not the same one that's in the DOM. I'm not sure how this is possible, since the framework manages, that, and should keep the same element throughout the lifecycle of the picker.

@nolanlawson
Copy link
Owner

Possibly related: #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants