diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index a142df363f..8083e576fd 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -892,33 +892,6 @@ table.promoted-attributes-in-tooltip th { opacity: 1; } -.algolia-autocomplete { - width: calc(100% - 30px); - z-index: 2000 !important; -} - -.algolia-autocomplete-container .aa-dropdown-menu { - position: inherit !important; - overflow: auto; -} - -.algolia-autocomplete .aa-input, -.algolia-autocomplete .aa-hint { - width: 100%; -} - -.algolia-autocomplete .aa-dropdown-menu { - width: 100%; - background-color: var(--main-background-color); - border: 1px solid var(--main-border-color); - border-top: none; - z-index: 2000 !important; - max-height: 500px; - overflow: auto; - padding: 0; - margin: 0; -} - .aa-dropdown-menu .aa-suggestion { cursor: pointer; padding: 6px 16px; diff --git a/apps/client/src/widgets/PromotedAttributes.tsx b/apps/client/src/widgets/PromotedAttributes.tsx index 2fbfa706b8..b1d45bd3bb 100644 --- a/apps/client/src/widgets/PromotedAttributes.tsx +++ b/apps/client/src/widgets/PromotedAttributes.tsx @@ -38,7 +38,6 @@ interface CellProps { } type OnChangeEventData = TargetedEvent | InputEvent; -type OnChangeListener = (e: OnChangeEventData) => void | Promise; export default function PromotedAttributes() { const { note, componentId, noteContext } = useNoteContext(); @@ -255,7 +254,7 @@ function LabelInput(props: CellProps & { inputId: string }) { className="open-external-link-button" icon="bx bx-window-open" title={t("promoted_attributes.open_external_link")} - onClick={(e) => { + onClick={() => { const inputEl = document.getElementById(inputId) as HTMLInputElement | null; const url = inputEl?.value; if (url) { diff --git a/apps/client/src/widgets/attribute_widgets/attribute_detail.ts b/apps/client/src/widgets/attribute_widgets/attribute_detail.ts index cd4427e893..5bc1b3f045 100644 --- a/apps/client/src/widgets/attribute_widgets/attribute_detail.ts +++ b/apps/client/src/widgets/attribute_widgets/attribute_detail.ts @@ -479,7 +479,6 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget { $(window).on("mousedown", (e) => { if (!$(e.target).closest(this.$widget[0]).length - && !$(e.target).closest(".algolia-autocomplete").length && !$(e.target).closest(HEADLESS_AUTOCOMPLETE_PANEL_SELECTOR).length && !$(e.target).closest("#context-menu-container").length) { this.hide(); diff --git a/apps/client/src/widgets/dialogs/jump_to_note.tsx b/apps/client/src/widgets/dialogs/jump_to_note.tsx index 89c4388039..3d013244b8 100644 --- a/apps/client/src/widgets/dialogs/jump_to_note.tsx +++ b/apps/client/src/widgets/dialogs/jump_to_note.tsx @@ -1,14 +1,15 @@ -import Modal from "../react/Modal"; -import Button from "../react/Button"; -import NoteAutocomplete from "../react/NoteAutocomplete"; -import { t } from "../../services/i18n"; import { useRef, useState } from "preact/hooks"; -import note_autocomplete, { Suggestion } from "../../services/note_autocomplete"; + import appContext from "../../components/app_context"; import commandRegistry from "../../services/command_registry"; -import { refToJQuerySelector } from "../react/react_utils"; -import { useTriliumEvent } from "../react/hooks"; +import { t } from "../../services/i18n"; +import note_autocomplete, { Suggestion } from "../../services/note_autocomplete"; import shortcutService from "../../services/shortcuts"; +import Button from "../react/Button"; +import { useTriliumEvent } from "../react/hooks"; +import Modal from "../react/Modal"; +import NoteAutocomplete from "../react/NoteAutocomplete"; +import { refToJQuerySelector } from "../react/react_utils"; const KEEP_LAST_SEARCH_FOR_X_SECONDS = 120; @@ -23,14 +24,14 @@ export default function JumpToNoteDialogComponent() { const [ initialText, setInitialText ] = useState(isCommandMode ? "> " : ""); const actualText = useRef(initialText); const [ shown, setShown ] = useState(false); - - async function openDialog(commandMode: boolean) { + + async function openDialog(commandMode: boolean) { let newMode: Mode; let initialText = ""; if (commandMode) { newMode = "commands"; - initialText = ">"; + initialText = ">"; } else if (Date.now() - lastOpenedTs <= KEEP_LAST_SEARCH_FOR_X_SECONDS * 1000 && actualText.current) { // if you open the Jump To dialog soon after using it previously, it can often mean that you // actually want to search for the same thing (e.g., you opened the wrong note at first try) @@ -58,7 +59,7 @@ export default function JumpToNoteDialogComponent() { if (!suggestion) { return; } - + setShown(false); if (suggestion.notePath) { appContext.tabManager.getActiveContext()?.setNote(suggestion.notePath); @@ -83,7 +84,7 @@ export default function JumpToNoteDialogComponent() { $autoComplete .trigger("focus") .trigger("select"); - + // Add keyboard shortcut for full search shortcutService.bindElShortcut($autoComplete, "ctrl+return", () => { if (!isCommandMode) { @@ -91,7 +92,7 @@ export default function JumpToNoteDialogComponent() { } }); } - + async function showInFullSearch() { try { setShown(false); @@ -126,18 +127,18 @@ export default function JumpToNoteDialogComponent() { setIsCommandMode(text.startsWith(">")); }} onChange={onItemSelected} - />} + />} onShown={onShown} onHidden={() => setShown(false)} - footer={!isCommandMode &&