AutoComplete onKeyPress does not work
See original GitHub issueThe onKeyPress seems to be missing on the AutoComplete. It works on the Input. I’m not sure if this is an issue with 2.5.0, i think it should have worked previously. We need this event to check for special keys.
@connect((state, props) => ({ item: state.elements[props.id] }))
export default class ConsoleElement extends React.PureComponent {
handleChange = value => this.props.dispatch(actions.update(this.props.id, { value }))
handleKeyPress = event =>this.props.dispatch(actions.event(this.props.id, event))
render() {
let { value, children } = this.props.item;
return (
<AutoComplete
ref="input"
placeholder="Just type ..."
style={{ ...this.props.style }}
value={value}
dataSource={children}
onChange={this.handleChange} onKeyPress={this.handleKeyPress} />
)
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Can't get autocomplete to work on first keypress - Stack Overflow
This initializes the Autocomplete when the page is ready. When the User enters a keystroke, then it is run, the default min length...
Read more >keypress on autocomplete is not firing why? - CodeProject
You need to change your keypress to either keydown or keyup and see if it works. If you absolutely have to change autocomplete,...
Read more >Keypress event doesn't work on textbox if AutoComplete set ...
The event doesn't even fire. It just highlights the text in the TextBox. By all rights it should "Stop" every time I press...
Read more >Javascript onkeypress event not working in webviewer
Hello, in the code below I have an HTML input which should accept only numbers. The functionality works in Chrome and Edge browsers, ......
Read more >[Solved]-onKeyPress event do not work if a textbox in form has ...
[Solved]-onKeyPress event do not work if a textbox in form has autocomplete?-winforms c# ... In your application you should not use form events...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@afc163 组件间的关系应该可以梳理一下,概念上,所有表单类组件都是 Input 的子类,所以基础的 API 应该都有。
现在使用了 TypeScript,所以我们可以定义 interface Input,并要求其他表单类组件都继承这个接口。
Popover Popconfirm Tooltip 也是类似的关系。
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.