Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details: The issue was related to portals and their management of outside-clicks, where Portal
support dismissing the Portal children component once a click outside the Portal is recongnize. The
issue can be reproduce on any element (Not just the Select component) by clicking on element that will be deleted from the DOM, In this case the click on the icon-delete button (x) was doing some internal logic of the Select component and then the icon-delete will be removed from the DOM, after that the click will be bubbled to the Portal and the portal will decide if the click is in/out the Portal to handle auto-close feature.
The Portal will search for icon-delete and see if it in the this.rootNode of the Portal, and because it has already deleted the icon from the DOM tree it will not find it in the rootNode and it will decide that it's was a click outside the Portal! Also, the event.target won't keep a full reference to the top body element in case we want to search the icon-delete parents! so the way is to use event.path / event.composedPath to have the full snapshot of the bubbled event