mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 12:45:38 +00:00
fix: crash double-click handling for collection and collection item (#5151)
This commit is contained in:
@@ -217,6 +217,12 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
);
|
||||
};
|
||||
|
||||
// prevent the parent's double-click handler from firing
|
||||
const handleFolderDoubleClick = (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const handleRightClick = (event) => {
|
||||
const _menuDropdown = dropdownTippyRef.current;
|
||||
if (_menuDropdown) {
|
||||
@@ -358,6 +364,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
className={iconClassName}
|
||||
style={{ color: 'rgb(160 160 160)' }}
|
||||
onClick={handleFolderCollapse}
|
||||
onDoubleClick={handleFolderDoubleClick}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -111,6 +111,12 @@ const Collection = ({ collection, searchText }) => {
|
||||
dispatch(toggleCollection(collection.uid));
|
||||
}
|
||||
|
||||
// prevent the parent's double-click handler from firing
|
||||
const handleCollectionDoubleClick = (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const handleRightClick = (event) => {
|
||||
const _menuDropdown = menuDropdownTippyRef.current;
|
||||
if (_menuDropdown) {
|
||||
@@ -223,6 +229,7 @@ const Collection = ({ collection, searchText }) => {
|
||||
className={`chevron-icon ${iconClassName}`}
|
||||
style={{ width: 16, minWidth: 16, color: 'rgb(160 160 160)' }}
|
||||
onClick={handleCollectionCollapse}
|
||||
onDoubleClick={handleCollectionDoubleClick}
|
||||
/>
|
||||
<div className="ml-1 w-full" id="sidebar-collection-name">
|
||||
{collection.name}
|
||||
|
||||
Reference in New Issue
Block a user