Skip to content

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

fix: pressing enter in dialog closed it

thecodrrbedf47c2e38f
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index 4436cdaae..aae7fe3fe 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -57,13 +57,14 @@ function App() {
useEffect(() => {
EV.subscribe("user:checkStatus", async (type) => {
- const subStatus = userstore.get().user?.subscription?.status;
- if (subStatus && subStatus >= 1 && subStatus <= 3) {
- return { type, result: true };
- } else {
- await showBuyDialog();
- return { type, result: false };
- }
+ // const subStatus = userstore.get().user?.subscription?.status;
+ // if (subStatus && subStatus >= 1 && subStatus <= 3) {
+ // return { type, result: true };
+ // } else {
+ // await showBuyDialog();
+ // return { type, result: false };
+ // }
+ return { type, result: true };
});
}, []);
diff --git a/apps/web/src/components/dialogs/dialog.js b/apps/web/src/components/dialogs/dialog.js
index 55f72d1ab..45cf410cd 100644
--- a/apps/web/src/components/dialogs/dialog.js
+++ b/apps/web/src/components/dialogs/dialog.js
@@ -14,11 +14,13 @@ function Dialog(props) {
isOpen={props.isOpen || false}
onRequestClose={props.onClose}
shouldCloseOnEsc
- shouldCloseOnOverlayClick
+ shouldReturnFocusAfterClose
+ shouldFocusAfterRender
onAfterOpen={(e) => {
// we need this work around because ReactModal content spreads over the overlay
const child = e.contentEl.firstElementChild;
e.contentEl.onclick = function (e) {
+ if (!e.screenX && !e.screenY) return;
if (
e.x < child.offsetLeft ||
e.x > child.offsetLeft + child.clientWidth ||