Skip to content

Pagination shown results does not reset on changed search #382

@daynekilheffer

Description

@daynekilheffer

Version

Identified in 2.6.0
Validated in 3.2.3 via docs

Steps to reproduce

http://ericgio.github.io/react-bootstrap-typeahead/#asynchronous-searching

In the pagination section,

  1. search for "al" and validate that you have the option to paginate
  2. search for "def" and validate that you have the option to paginate
  3. paginate your results (the "def" search) at least once
  4. select all text and type "al" (do not blur the input)
  5. validate that you no longer have the option to paginate

Expected Behavior

The search for "al" in the scenario above should still show pagination controls as there is more data to display. We have limited results from the api call, but could get more if the user desires.

(note: the following may be related to async only, I'd have to think through what I'd expect in a standard typeahead)
The pagination construct is a function of the search string that you are executing, so any changes to that search string should reset the pagination settings.

Actual Behavior

shownResults is left at 2 * maxResults (after one pagination on "def"), but the max number of results the api returns for "al" is 50. Since the number of "al" results is less than the shownResults, the pagination controls are not rendered.

The typeahead does reset the shownResults value if you hide the menu as it resets a few state values to the initial props (typeaheadContainer -> _hideMenu).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions