mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
editor: fix dropdown needing 2 clicks to open
This commit is contained in:
committed by
Abdullah Atta
parent
0d714847f3
commit
b1d4ccc27e
@@ -45,7 +45,7 @@ export function Dropdown(props: DropdownProps) {
|
||||
const isMobile = useIsMobile();
|
||||
const isBottom = toolbarLocation === "bottom";
|
||||
|
||||
const { closePopup, isPopupOpen } = usePopupHandler({
|
||||
const { isPopupOpen } = usePopupHandler({
|
||||
group,
|
||||
id,
|
||||
isOpen,
|
||||
@@ -82,7 +82,15 @@ export function Dropdown(props: DropdownProps) {
|
||||
selectedItem
|
||||
)}
|
||||
<Icon
|
||||
path={isBottom ? Icons.chevronUp : Icons.chevronDown}
|
||||
path={
|
||||
isBottom
|
||||
? isPopupOpen
|
||||
? Icons.chevronDown
|
||||
: Icons.chevronUp
|
||||
: isPopupOpen
|
||||
? Icons.chevronUp
|
||||
: Icons.chevronDown
|
||||
}
|
||||
size={"small"}
|
||||
color={"text"}
|
||||
/>
|
||||
@@ -91,7 +99,7 @@ export function Dropdown(props: DropdownProps) {
|
||||
<MenuPresenter
|
||||
isOpen={isPopupOpen}
|
||||
items={items}
|
||||
onClose={() => closePopup(id)}
|
||||
onClose={() => setIsOpen(false)}
|
||||
position={{
|
||||
target: isBottom
|
||||
? getToolbarElement()
|
||||
|
||||
Reference in New Issue
Block a user