Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): note context active indicator disappears after typing

Elian Doran6762539b4d53
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts
index fa912e25a8..460034591d 100644
--- a/apps/client/src/widgets/note_wrapper.ts
+++ b/apps/client/src/widgets/note_wrapper.ts
@@ -1,11 +1,11 @@
-import FlexContainer from "./containers/flex_container.js";
-import utils from "../services/utils.js";
-import attributeService from "../services/attributes.js";
-import type BasicWidget from "./basic_widget.js";
import type { EventData } from "../components/app_context.js";
import type NoteContext from "../components/note_context.js";
import type FNote from "../entities/fnote.js";
+import attributeService from "../services/attributes.js";
import { getLocaleById } from "../services/i18n.js";
+import utils from "../services/utils.js";
+import type BasicWidget from "./basic_widget.js";
+import FlexContainer from "./containers/flex_container.js";
export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
@@ -43,11 +43,16 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
refresh() {
const isHiddenExt = this.isHiddenExt(); // preserve through class reset
+ const isActive = this.$widget.hasClass("active");
this.$widget.removeClass();
this.toggleExt(!isHiddenExt);
+ if (isActive) {
+ this.$widget.addClass("active");
+ }
+
this.$widget.addClass("component note-split");
const note = this.noteContext?.note;
@@ -92,7 +97,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
#hasBackgroundEffects(note: FNote): boolean {
const MIME_TYPES_WITH_BACKGROUND_EFFECTS = [
"application/pdf"
- ]
+ ];
if (note.isOptions()) {
return true;