palantir/blueprint
View on GitHubQuestion: [Omnibar]: How do I get the keyboard controls to work when initialContent is displayed?
Open
#3,160 opened on Nov 16, 2018
Package: selectType: enhancementhelp wanted
Description
Environment
- Package version(s): @blueprintjs/core - v3.7.0 & @blueprintjs/select v3.2.0
- Browser and OS versions: Chrome v70 / macOS Sierra
Question
I'm using Omnibar in https://pasteapp.com.
My setup is as follows;
- I have a React Component
Foo - The component Foo is stateful
- The state is composed of items and filtered items
- The component renders Omnibar like this;
<Omnibar
isOpen={this.props.isOpen}
itemRenderer={this.renderItem}
onQueryChange={this.handleQueryChange}
items={this.state.filteredItems}
onItemSelect={this.props.onItemSelect}
onClose={this.props.onClose}
inputProps={{
leftIcon: null
}}
/>
It works just fine, I can use keyboard controls (arrow keys) to go up/down in the results, however, as soon as I introduce initialContent like this;
<Omnibar
...
initialContent={this.state.items.slice(0, 10).map(this.renderItem)}
/>
...the items are shown, but I can't use the keyboard controls anymore. No exceptions were thrown, or errors were logged.
What am I doing wrong here?