fix: fixed collection collapse while adding folders

This commit is contained in:
Anoop M D 2022-03-13 20:29:47 +05:30
parent 2f594835d8
commit e775cd47a9
3 changed files with 17 additions and 17 deletions

View File

@ -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}

View File

@ -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>

View File

@ -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}