yairEO / tagify

šŸ”– lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue
https://yaireo.github.io/tagify/
Other
3.56k stars 436 forks source link

Select mode error in Chrome when using keyboard #1401

Closed Massi-X closed 2 weeks ago

Massi-X commented 3 weeks ago

Prerequisites

šŸ’„ Demo Page

https://jsbin.com/sarufovumi/edit?js,console,output

Explanation

Hi again! I had an edge case when the mode is set to select. First let's clarify that the error only appears in Chrome and it is exactly this one Stackoverflow, see section '2024 Update' for the open bug in Chrome issue tracker. To trigger the error follow these steps:

  1. Use Chrome obviously
  2. Go to Jsbin and select an initial value from the dropdown
  3. Now use the keyboard to remove part of the input but not all (leave for example a "T" or "O") so that another value shows up in the dropdown and the input still contains a letter
  4. Now select a different value than before using the keyboard with arrows + Enter (with the mouse everything works fine)
  5. The error Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it was moved in a 'blur' event handler? is triggered and tagify fails to correctly fill the input