Pagination item not compatible with `labelKey` callback
See original GitHub issueVersion
3.0.4
Steps to reproduce
Use <Typeahead> with options objects array larger than 100 (to trigger pagination) and use labelKey as labelKey={option => option.value}
Expected Behavior
Work properly
Actual Behavior
Crash
Uncaught Error: One or more options does not have a valid label string. Check the
labelKey
prop to ensure that it matches the correct option key and provides a string for filtering and display.
Further notes
It works with version ~2.3.0~ 2.6.0
Case 1: When I use labelKey={"value"}
it works fine.
Case 2: When I use labelKey={option => `${option.value}`}
it doesn’t crash anymore, but when scrolling to the bottom, instead of “Display additional results…” I see “undefined”, and when clicking on it, it loads more results as intended. In this case, passing paginationText
has no effect, it keeps showing “undefined” (tried both passing string and paginationText={{ value: "Display additional results..." }}
)
For now I will either disable pagination as the label isn’t always on top level of the object to use labelKey as in case 1, or revert back to ~2.3.0~ 2.6.0 until this is fixed 😕 hopefully it’s easy to fix.
And btw, thanks for all the work and effort put into making this package!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Looks like it’s all there in v3.1.1. Sorry about that!
This should be fixed as of v3.1.0.