Skip to content

Build your personal knowledge base with Trilium Notes

docs(note_type_chooser): shorten the focus comments

Elian Doran56064bac78c2
diff --git a/apps/client/src/stylesheets/theme-next/dialogs.css b/apps/client/src/stylesheets/theme-next/dialogs.css
index 1062785177..24fd3be9f8 100644
--- a/apps/client/src/stylesheets/theme-next/dialogs.css
+++ b/apps/client/src/stylesheets/theme-next/dialogs.css
@@ -436,9 +436,8 @@ div.tn-tool-dialog {
* NOTE TYPE CHOOSER DIALOG
*/
-/* Focus reads as fill plus ring, so it differs from hover in kind and not only in shade. :focus,
- not :focus-visible, so the pointer and keyboard paths match; the :hover selector holds the fill
- against style.css, which tints anything hovered that is not .active. */
+/* :focus, not :focus-visible, so the pointer and keyboard paths match. The :hover selector keeps
+ style.css from tinting the focused row, which it does to anything hovered that is not .active. */
:root .note-type-chooser-dialog .dropdown-item:focus,
:root .note-type-chooser-dialog .dropdown-item:focus:hover {
outline: 2px solid var(--input-focus-outline-color) !important;
diff --git a/apps/client/src/widgets/dialogs/note_type_chooser.tsx b/apps/client/src/widgets/dialogs/note_type_chooser.tsx
index 60c724e8f1..2218e87222 100644
--- a/apps/client/src/widgets/dialogs/note_type_chooser.tsx
+++ b/apps/client/src/widgets/dialogs/note_type_chooser.tsx
@@ -127,9 +127,8 @@ export default function NoteTypeChooserDialogComponent() {
}
/**
- * Focuses the first note type so that Enter creates a text note. The types load asynchronously and
- * Bootstrap focuses the first field itself once the dialog is up, so both their arrival and
- * `onShown` apply the focus. Both back off once the user has moved focus on their own.
+ * Focuses the first note type so Enter creates a text note, until the user moves focus themselves.
+ * Both the arrival of the types and `onShown` apply it, since either can be the one that comes last.
*/
function useFirstNoteTypeFocus(modalRef: RefObject<HTMLDivElement>, shown: boolean, noteTypeCount: number) {
const userMovedFocus = useRef(false);