react-autosuggest icon indicating copy to clipboard operation
react-autosuggest copied to clipboard

When clicking custom elements added to the suggestions or suggestions container, suggestion's container won't close

Open gl0gl0 opened this issue 7 years ago • 4 comments

When clicking custom elements added to the suggestions or suggestions container, suggestion's container won't close.

For example: If I want to add a copy to search bar arrow to the suggestions elements (kind of how youtube's mobile app suggestions have). When clicking the arrow, and copying the suggestion value to the search input, there is no way to close the suggestions dropdown even if you click outside of it.

Codepen: https://codepen.io/anon/pen/LzwZzq

Steps to reproduce:

  1. Focus on the input field.
  2. Type c, wait for suggestions to appear.
  3. Click the 'click here to say hello' link.
  4. Click outside suggestion's input/container, see that it won't close.

Observed behaviour: Suggestions stay open

Expected behaviour: Suggestions should be closed

Same happens with custom elements you add to the renderSuggestionsContainer.

gl0gl0 avatar Oct 25 '17 16:10 gl0gl0

I'm having the same issue. I tried removing alwaysRenderSuggestions: true, but it doesn't seem to have an effect.

n8thegr8 avatar Oct 26 '17 18:10 n8thegr8

i have same issue. but i had solve this to use "data-*" (i think isn't best way...)

here is my solve. https://codepen.io/anon/pen/MOdzbM

GenesisSam avatar Dec 07 '17 05:12 GenesisSam

@GenesisSam If you add alwaysRenderSuggestions={true} on your codepen the issue will happens. This is the result after add this property and select a option: screen shot 2018-01-07 at 22 00 18

levymoreira avatar Jan 07 '18 22:01 levymoreira

Any status on this? This issue still remains as of today with version 10.0.2

krystianH avatar May 15 '20 08:05 krystianH