bug(Select): 'view more' feature is problematic when used with the typeahead variant
Describe the issue. What is the expected and unexpected behavior?
-
onSelect should provide the information if an option is
isLoad(View more) the same way it does for theisPlaceholderView moreshould be handled by the consumers in a special way, not like a normal SelectOption. -
Clicking
View moretwice in a row crashes the component with;this.refCollection[this.state.viewMoreNextIndex][0] is undefined
Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.
https://codesandbox.io/s/eager-wind-eqq1j?file=/index.js
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around? bug
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Not stale; still a bug.
It doesn't look like isLoad is the culprit. I am assuming the behavior has changed since the component now crashes after a single click.
In any case clicking "View More" causes componentDidUpdate to execute twice. Problem is that the first time it's executed the new items aren't part of the refCollection yet (only when using typeahead). Putting a null-check on the focus will make it work but I don't know if that's a proper fix.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.