Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ui: fix menu going under the listitem

thecodrr45b4cdb5b615
diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.js
index 05ec989c5..288838ed6 100644
--- a/apps/web/src/components/list-item/index.js
+++ b/apps/web/src/components/list-item/index.js
@@ -8,10 +8,10 @@ import Menu from "../menu";
const ListItem = props => (
<Flex
onClick={e => {
+ e.stopPropagation();
if (props.onClick) {
props.onClick();
}
- e.stopPropagation();
}}
alignItems="center"
justifyContent="space-between"
@@ -24,8 +24,8 @@ const ListItem = props => (
marginTop: props.pinned ? 4 : 0,
borderBottom: "1px solid",
borderBottomColor: "navbg",
- cursor: "default",
- ...ButtonPressedStyle
+ cursor: "default"
+ //TODO add onpressed reaction
}}
>
{props.pinned && (
@@ -81,7 +81,7 @@ const ListItem = props => (
</Text>
</Box>
<Dropdown
- style={{ zIndex: 999 }}
+ style={{ zIndex: 1 }}
ref={ref => (props.dropdownRefs[props.index] = ref)}
>
<DropdownTrigger>
@@ -91,7 +91,7 @@ const ListItem = props => (
style={{ marginRight: -5 }}
/>
</DropdownTrigger>
- <DropdownContent style={{ zIndex: 999, marginLeft: -110 }}>
+ <DropdownContent style={{ zIndex: 2, marginLeft: -110 }}>
<Menu
dropdownRef={props.dropdownRefs[props.index]}
menuItems={props.menuItems}
diff --git a/apps/web/src/components/menu/index.js b/apps/web/src/components/menu/index.js
index 3ec647fa7..c205c9df3 100644
--- a/apps/web/src/components/menu/index.js
+++ b/apps/web/src/components/menu/index.js
@@ -19,13 +19,13 @@ function Menu(props) {
<Flex
key={item.title}
onClick={e => {
+ e.stopPropagation();
if (props.dropdownRef) {
props.dropdownRef.hide();
}
if (item.onClick) {
item.onClick(props.data);
}
- e.stopPropagation();
}}
flexDirection="row"
alignItems="center"
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index 4788d2a83..86cb988fd 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -42,13 +42,15 @@ const menuItems = note => [
color: "red",
onClick: () => {
ev.emit("onClearNote", note.dateCreated);
- db.deleteNotes([note]).then(
- //TODO implement undo
- () => {
- showSnack("Note deleted!", Icon.Check);
- ev.emit("refreshNotes");
- }
- );
+ db.deleteNotes([note])
+ .then(
+ //TODO implement undo
+ () => {
+ showSnack("Note deleted!", Icon.Check);
+ ev.emit("refreshNotes");
+ }
+ )
+ .catch(console.log);
}
}
];