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:
Carlos Valente
2023-06-05 20:52:09 +02:00
committed by GitHub
parent 7cfe7c0d78
commit a3487e7073
21 changed files with 41 additions and 26 deletions
+1 -1
View File
@@ -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();
}