Merge pull request #299 from ilumin/feature/double-click-rename

feat(291): add double click request to open rename modal
This commit is contained in:
Anoop M D 2023-10-04 03:40:29 +05:30 committed by GitHub
commit e4ea6b9109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,10 @@ const CollectionItem = ({ item, collection, searchText }) => {
}
};
const handleDoubleClick = (event) => {
setRenameItemModalOpen(true);
};
let indents = range(item.depth);
const onDropdownCreate = (ref) => (dropdownTippyRef.current = ref);
const isFolder = isItemAFolder(item);
@ -178,6 +182,7 @@ const CollectionItem = ({ item, collection, searchText }) => {
return (
<div
onClick={handleClick}
onDoubleClick={handleDoubleClick}
className="indent-block"
key={i}
style={{
@ -193,6 +198,7 @@ const CollectionItem = ({ item, collection, searchText }) => {
: null}
<div
onClick={handleClick}
onDoubleClick={handleDoubleClick}
className="flex flex-grow items-center h-full overflow-hidden"
style={{
paddingLeft: 8