stopPropagation() causes autosuggest doesn't close the dropdown
I have a button inside the suggestion as follows:

When I click on the right side button (close icon) I have to use e.stopPropagation() to prevent clicking on the suggestion itself and then remove that suggestion. After removing the item I can't close the dropdown anymore when click outside of the dropdown.
I have exactly the same issue. Any ideas on how to fix it?
I managed it like this:
I removed e. stopPropagation() so now when we click on the close button two different functions are being called in this order: 1- onRemoveClick 2- onSuggestionSelected.
When I click on remove button I set a flag true and then inside onSuggestionSelected I'm checking that flag and if that is not true I will go through the functionality, otherwise it does nothing.
@sepehra1313
Can you explain what do you mean by: otherwise it does nothing..
How do you prevent the dropdown from closing without e.stopPropagation()?
I managed it like this: I removed
e. stopPropagation()so now when we click on the close button two different functions are being called in this order: 1-onRemoveClick2-onSuggestionSelected. When I click on remove button I set a flagtrueand then insideonSuggestionSelectedI'm checking that flag and if that is nottrueI will go through the functionality, otherwise it does nothing.
Still now working as expected since onRemoveClick would still close the suggestion list immediately after fired, I would like to keep the suggestion list open while interacting with its childs.