react-complex-tree
Advanced tools
Comparing version 2.4.3 to 2.4.4
@@ -33,2 +33,4 @@ "use strict"; | ||
var isRenaming = !!renamingItem; | ||
var disableArrowKeys = environment.disableArrowKeys; | ||
var enableArrowKeys = !disableArrowKeys && isActiveTree && !isRenaming; | ||
(0, useKey_1.useKey)('arrowdown', function (e) { | ||
@@ -45,3 +47,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
(0, useKey_1.useKey)('arrowup', function (e) { | ||
@@ -58,3 +60,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
(0, useHotkey_1.useHotkey)('moveFocusToFirstItem', function (e) { | ||
@@ -81,3 +83,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
(0, useKey_1.useKey)('arrowleft', function (e) { | ||
@@ -100,3 +102,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
(0, useHotkey_1.useHotkey)('primaryAction', function (e) { | ||
@@ -103,0 +105,0 @@ var _a, _b; |
@@ -152,2 +152,3 @@ import React, { FormHTMLAttributes, HTMLProps, InputHTMLAttributes, Ref } from 'react'; | ||
canDropBelowOpenFolders?: boolean; | ||
disableArrowKeys?: boolean; | ||
} | ||
@@ -154,0 +155,0 @@ export type IndividualTreeViewState<C extends string = never> = { |
@@ -30,2 +30,4 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
var isRenaming = !!renamingItem; | ||
var disableArrowKeys = environment.disableArrowKeys; | ||
var enableArrowKeys = !disableArrowKeys && isActiveTree && !isRenaming; | ||
useKey('arrowdown', function (e) { | ||
@@ -42,3 +44,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
useKey('arrowup', function (e) { | ||
@@ -55,3 +57,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
useHotkey('moveFocusToFirstItem', function (e) { | ||
@@ -78,3 +80,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
useKey('arrowleft', function (e) { | ||
@@ -97,3 +99,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
useHotkey('primaryAction', function (e) { | ||
@@ -100,0 +102,0 @@ var _a, _b; |
@@ -152,2 +152,3 @@ import React, { FormHTMLAttributes, HTMLProps, InputHTMLAttributes, Ref } from 'react'; | ||
canDropBelowOpenFolders?: boolean; | ||
disableArrowKeys?: boolean; | ||
} | ||
@@ -154,0 +155,0 @@ export type IndividualTreeViewState<C extends string = never> = { |
@@ -30,2 +30,4 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
var isRenaming = !!renamingItem; | ||
var disableArrowKeys = environment.disableArrowKeys; | ||
var enableArrowKeys = !disableArrowKeys && isActiveTree && !isRenaming; | ||
useKey('arrowdown', function (e) { | ||
@@ -42,3 +44,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
useKey('arrowup', function (e) { | ||
@@ -55,3 +57,3 @@ e.preventDefault(); | ||
} | ||
}, isActiveTree && !isRenaming); | ||
}, enableArrowKeys); | ||
useHotkey('moveFocusToFirstItem', function (e) { | ||
@@ -78,3 +80,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
useKey('arrowleft', function (e) { | ||
@@ -97,3 +99,3 @@ e.preventDefault(); | ||
}); | ||
}, isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming); | ||
}, enableArrowKeys && !dnd.isProgrammaticallyDragging); | ||
useHotkey('primaryAction', function (e) { | ||
@@ -100,0 +102,0 @@ var _a, _b; |
@@ -152,2 +152,3 @@ import React, { FormHTMLAttributes, HTMLProps, InputHTMLAttributes, Ref } from 'react'; | ||
canDropBelowOpenFolders?: boolean; | ||
disableArrowKeys?: boolean; | ||
} | ||
@@ -154,0 +155,0 @@ export type IndividualTreeViewState<C extends string = never> = { |
{ | ||
"name": "react-complex-tree", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"main": "lib/cjs/index.js", | ||
@@ -38,3 +38,3 @@ "module": "lib/esm/index.js", | ||
"cpy-cli": "^3.1.1", | ||
"demodata": "^2.4.3", | ||
"demodata": "^2.4.4", | ||
"jest": "^29.2.2", | ||
@@ -71,3 +71,3 @@ "jest-dom": "^4.0.0", | ||
}, | ||
"gitHead": "da481d50021582c9c7c5cb39a031d81b6689c858" | ||
"gitHead": "c107f8f07c00d1d0eb159256003b64e755ab96a3" | ||
} |
@@ -22,2 +22,4 @@ import { useKey } from '../hotkeys/useKey'; | ||
const isRenaming = !!renamingItem; | ||
const { disableArrowKeys } = environment; | ||
const enableArrowKeys = !disableArrowKeys && isActiveTree && !isRenaming; | ||
@@ -38,3 +40,3 @@ useKey( | ||
}, | ||
isActiveTree && !isRenaming | ||
enableArrowKeys | ||
); | ||
@@ -56,3 +58,3 @@ | ||
}, | ||
isActiveTree && !isRenaming | ||
enableArrowKeys | ||
); | ||
@@ -93,3 +95,3 @@ | ||
}, | ||
isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming | ||
enableArrowKeys && !dnd.isProgrammaticallyDragging | ||
); | ||
@@ -118,3 +120,3 @@ | ||
}, | ||
isActiveTree && !dnd.isProgrammaticallyDragging && !isRenaming | ||
enableArrowKeys && !dnd.isProgrammaticallyDragging | ||
); | ||
@@ -121,0 +123,0 @@ |
@@ -196,2 +196,4 @@ import React, { | ||
canDropBelowOpenFolders?: boolean; | ||
disableArrowKeys?: boolean; | ||
} | ||
@@ -198,0 +200,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1320729
20562