mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 15:19:01 +01:00
fix: fixed collection collapse while adding folders
This commit is contained in:
parent
2f594835d8
commit
e775cd47a9
@ -5,7 +5,7 @@ import StyledWrapper from './StyledWrapper';
|
||||
const Dropdown = ({icon, children, onCreate, placement}) => {
|
||||
return (
|
||||
<StyledWrapper className="dropdown">
|
||||
<Tippy
|
||||
<Tippy
|
||||
content={children}
|
||||
placement={placement || "bottom-end"}
|
||||
animation={false}
|
||||
|
@ -33,8 +33,12 @@ const Collection = ({collection}) => {
|
||||
});
|
||||
|
||||
const handleClick = (event) => {
|
||||
let envTippyEl = get(menuDropdownTippyRef, 'current.reference');
|
||||
if(envTippyEl && envTippyEl.contains && envTippyEl.contains(event.target)) {
|
||||
let tippyEl = get(menuDropdownTippyRef, 'current.reference');
|
||||
if(tippyEl && tippyEl.contains && tippyEl.contains(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(event && event.target && event.target.className === 'dropdown-item') {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -61,20 +65,16 @@ const Collection = ({collection}) => {
|
||||
<span className="ml-1">{collection.current.name}</span>
|
||||
<div className="collection-actions">
|
||||
<Dropdown onCreate={onMenuDropdownCreate} icon={<MenuIcon />} placement='bottom-start'>
|
||||
<div>
|
||||
<div className="dropdown-item" onClick={(e) => {
|
||||
menuDropdownTippyRef.current.hide();
|
||||
}}>
|
||||
Add Request
|
||||
</div>
|
||||
<div className="dropdown-item" onClick={(e) => {
|
||||
menuDropdownTippyRef.current.hide();
|
||||
}}>
|
||||
Add Request
|
||||
</div>
|
||||
<div>
|
||||
<div className="dropdown-item" onClick={(e) => {
|
||||
menuDropdownTippyRef.current.hide();
|
||||
setShowAddFolderModal(true)
|
||||
}}>
|
||||
Add Folder
|
||||
</div>
|
||||
<div className="dropdown-item" onClick={(e) => {
|
||||
menuDropdownTippyRef.current.hide();
|
||||
setShowAddFolderModal(true)
|
||||
}}>
|
||||
Add Folder
|
||||
</div>
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@ const Sidebar = ({collections, actions, dispatch, activeRequestTabId}) => {
|
||||
<div className="flex flex-row h-full">
|
||||
<MenuBar />
|
||||
|
||||
<div>
|
||||
<div className="flex flex-col flex-grow">
|
||||
<TitleBar
|
||||
actions={actions}
|
||||
dispatch={dispatch}
|
||||
|
Loading…
Reference in New Issue
Block a user