Skip to content

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

fix: create notebook dialog is not focused on open (#35)

Muhammad Ali631a556a1819
diff --git a/apps/web/src/components/dialogs/add-notebook-dialog.js b/apps/web/src/components/dialogs/add-notebook-dialog.js
index 1e1e15701..4b4635a30 100644
--- a/apps/web/src/components/dialogs/add-notebook-dialog.js
+++ b/apps/web/src/components/dialogs/add-notebook-dialog.js
@@ -4,6 +4,7 @@ import { Input, Checkbox, Label } from "@rebass/forms";
import * as Icon from "react-feather";
import Dialog from "./dialog";
import { showSnack } from "../snackbar";
+import { useEffect } from "react";
export default class AddNotebookDialog extends React.Component {
title = [];
@@ -33,6 +34,7 @@ export default class AddNotebookDialog extends React.Component {
content={
<Box my={1}>
<Input
+ autoFocus
variant="default"
onChange={e => (this.title = e.target.value)}
placeholder="Enter name"
diff --git a/apps/web/src/views/Notebooks.js b/apps/web/src/views/Notebooks.js
index dbcf23269..87ed16554 100644
--- a/apps/web/src/views/Notebooks.js
+++ b/apps/web/src/views/Notebooks.js
@@ -40,7 +40,9 @@ const Notebooks = props => {
)}
button={{
content: "Create a notebook",
- onClick: async () => setOpen(true)
+ onClick: async () => {
+ setOpen(true);
+ }
}}
/>
<AddNotebookDialog