-
Notifications
You must be signed in to change notification settings - Fork 183
Open
Description
react-image-annotate/src/ClassSelectionMenu/index.js
Lines 61 to 75 in ca3e864
useEffect(() => { | |
const keyMapping = {} | |
for (let i = 0; i < 9 && i < regionClsList.length; i++) { | |
keyMapping[i + 1] = () => onSelectCls(regionClsList[i]) | |
} | |
const onKeyDown = (e) => { | |
if (keyMapping[e.key]) { | |
keyMapping[e.key]() | |
e.preventDefault() | |
e.stopPropagation() | |
} | |
} | |
window.addEventListener("keydown", onKeyDown) | |
return () => window.removeEventListener("keydown", onKeyDown) | |
}, [regionClsList, selectedCls]) |
This is a breaking change in 1.8.0
Metadata
Metadata
Assignees
Labels
No labels