I want to use a keyDown event on a div in React. I do:
componentWillMount() { document.addEventListener(\"keydown\", this.onKeyPressed.bind(this));
The answer with
works for me, please note that the tabIndex requires a number, not a string, so tabIndex="0" doesn't work. 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
works for me, please note that the tabIndex requires a number, not a string, so tabIndex="0" doesn't work.