react-autosuggest
react-autosuggest copied to clipboard
Warning: Each child in a list should have a unique "key" prop. Check the render method of `AutoSuggest`.
Are you reporting a bug?
Yes
-
Please create a Codepen that demonstrates your issue. You can start from the Basic example.
-
Provide the steps to reproduce the issue, e.g.:
- Focus on the input field
- Type
c
, and wait for suggestions to appear - Press Escape
Observed behaviour: Suggestions stay open
Expected behaviour: Suggestions should be closed
Are you making a feature request?
-
Please describe your use case from user journey point of view, e.g.:
In my application, when user highlights suggestions (using the mouse or keyboard), I'd like to display additional information about the highlighted suggestion alongside the Autosuggest.
-
If you have ideas how to extend the Autosuggest API to support your new feature, please share!
-
If you know any examples online that already implement such functionality, please share a link.
Please help how to resolve this issue
whenever using a map make sure to use unique keys. this should solve the issue
example:
{parts.map((part, index) => (
<span key={part.text+"_"+index} style={{ fontWeight: part.highlight ? 500 : 400 }}>
{part.text}
</span>
))}
Has this been solved?
yes
Hello @mahesh5b5 , if this issue is solved, can you provide the link to the PR fixing the issue please? Btw I think this issue can be solved.
ps: I reproduce something similar in 9.4.3 version.