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

Fix selectOption failure #1425

Closed
wants to merge 1 commit into from
Closed

Conversation

Massi-X
Copy link
Contributor

@Massi-X Massi-X commented Dec 9, 2024

In some rare cases selectOption will fail because parentNode is null. I must say this does not happen on jsbin. To trigger it I did:

  1. Click on the input without entering edit mode so no caret (clicking on the borders outside of text trigger this for me)
  2. Select an option

Now the first click will fail and I have to click twice, this happens because for some reason tagElm (which is equal in this case to this.state.editing.scope) refers to an old element that is already removed from the page. Simply skipping the replaceTag if parentNode is null is enough to fix this

See video with error too:

1.mov

In some rare cases selectOption will fail because parentNode is null. Bypassing that part of code is enough to fix it
@yairEO
Copy link
Owner

yairEO commented Dec 20, 2024

Thanks! I've re-implemented this in a slightly different way

@yairEO yairEO closed this Dec 20, 2024
yairEO added a commit that referenced this pull request Dec 21, 2024
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

Successfully merging this pull request may close these issues.

2 participants