Skip to content

Paginating with keyboard appears selected when it is not #400

@Pjohnsonator

Description

@Pjohnsonator

Version

3.2.4

Steps to reproduce

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

In the pagination section

  1. search for "0"
  2. use the up arrow key to jump to the "Display additional results..."
  3. press enter to paginate

Expected Behavior

The selected result is the first from the next page of results. Pressing enter again should have invoke an onSearch with "550", the menu should close (showMenu: false, shownResults: 100) and the input text should reflect "550" (text: '550', activeItem: null, initialItem: '550', activeIndex: -1).

Actual Behavior

The selected result appears to be the first result from the next page. Pressing enter invokes onPaginate. The menu is still open (showMenu: true, shownResults: 300) and the input text still reflects "0" (text: '0', activeItem: { label: 'Display additional results...' }, initialItem: '0', activeIndex: 100).

Additional Detail

After step 2

  • MenuItemContainer(BaseMenuItem) with prop position: 100 has a prop option: { label: 'Display additional results...' }
  • The respective BaseMenuItem has prop active: true
  • TypeaheadContainer(WrapperTypeahead) has state paginationOption: true, activeIndex: 100, activeItem: { label: 'Display additional results...' }, and shownResults: 100

After step 3

  • MenuItemContainer(BaseMenuItem) with prop position: 100 has a prop option: '550'
  • The respective BaseMenuItem has prop active: true
  • TypeaheadContainer(WrapperTypeahead) has state paginationOption: true, activeIndex: 100, activeItem: { label: 'Display additional results...' }, and shownResults: 200

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions