-
Notifications
You must be signed in to change notification settings - Fork 531
Cannot select via click if rendered item is an imported Component. #365
Comments
Autocomplete uses lots of react-autocomplete/lib/Autocomplete.js Line 466 in 46300e9
|
@cinan Thanks. How do I make them aware? The renderItem method only passes two values to the component. |
The on* props are injected by Autocomplete library. Example for renderItem (note <Autocomplete
/// ...
renderItem={(item, highlight) => <Item item={item} highlight={highlight} />}
/>
class Item extends React.Component {
render() {
const { item, highlight, ...events } = this.props;
return (
<SomeComponent key={item} highlight={highlight} {...events}>{item}</SomeComponent>
);
}
} |
@cinan I just tried exactly that, but there are no event handlers being passed to the component at all. |
I'm also facing the same issue. It works when I comment out my |
For me, this was happening because I was programmatically toggling the |
Hello all. I am facing the same issue, not being able to select and item. I don't have any blur events but my console does lights up with: **Warning: Stateless function components cannot be given refs. Attempts to access this ref will fail. Check the render method of Any thoughts or experience with this? So my issue was two fold: one using function components to return other components and multiple nesting divs inside. In summary I simplified it as much as I could without disrupting the prop flow down Example : renderItem={Content} where as before it was this convoluted (a,c,v)=> <Content {...a}/>
|
If I set the "renderItem" prop to be a component that has been imported, then clicking on the items in the menu does not trigger the onSelect method. The items also do not get isHighlighted on mouse over. Navigating by keyboard does work.
The text was updated successfully, but these errors were encountered: