mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
v2 cleanup (#427)
* refactor: remove useless template * refactor: handle promise * refactor: associate labels to fields * refactor: simplify checking if element exists * refactor: prevent reassigning * refactor: avoid wildcard imports * refactor: simplify imports * refactor: simplify boolean comparison * chore: version bump
This commit is contained in:
@@ -8,7 +8,7 @@ export const useKeyDown: UseKeyDown = (callback, targetKey, options = {}) => {
|
||||
const onKeyDown = useCallback(
|
||||
(event: KeyboardEvent) => {
|
||||
const targetKeyPressed = event.key === targetKey && !event.repeat;
|
||||
if (targetKeyPressed && isDisabled === false) {
|
||||
if (targetKeyPressed && !isDisabled) {
|
||||
event.preventDefault();
|
||||
callback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user