-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
When I want to use react-keydown with a component rendering an array or a React.Fragment, it's working only if i click on the first item of the array (respectively first child of the Fragment).
import React, { PureComponent, Fragment } from 'react'
import keydown from 'react-keydown'
import TreeViewHeader from './TreeViewHeader'
import TreeViewComponent from './TreeView'
export default class TreeView extends PureComponent {
@keydown('up')
selectPreviousRow (event) {
console.log('select previous row', event)
}
render () {
return (
<Fragment>
<TreeViewHeader />
<TreeViewComponent />
</Fragment>
)
}
}
In this example, it's working only if I click on the first item. I tried to swipe TreeViewHeader and TreeViewComponent, and then it's working only if I click on TreeViewComponent
For now as a workaround I wrap all inside a div and it's working, but I would prefer to use a Fragment.
Thanks for your help,
Luca
Metadata
Metadata
Assignees
Labels
No labels