From e0e8db8d55570a68c579bbef0d9c5720ec700091 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 25 Dec 2024 18:51:52 +0100 Subject: [PATCH] fix: :bug: Don't trigger theme changes when in contenteditable fields --- layouts/app.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/app.vue b/layouts/app.vue index 5173bd3..ca52dbb 100644 --- a/layouts/app.vue +++ b/layouts/app.vue @@ -45,7 +45,8 @@ const activeElement = useActiveElement(); const notUsingInput = computed( () => activeElement.value?.tagName !== "INPUT" && - activeElement.value?.tagName !== "TEXTAREA", + activeElement.value?.tagName !== "TEXTAREA" && + activeElement.value?.contentEditable !== "true", ); const backgroundImage = useSetting(SettingIds.BackgroundURL); @@ -53,14 +54,14 @@ const canParseUrl = URL.canParse; const route = useRoute(); -watchEffect(async () => { +watch([n, notUsingInput, d], async () => { if (n?.value && notUsingInput.value) { // Wait 50ms await new Promise((resolve) => setTimeout(resolve, 50)); useEvent("composer:open"); } - if (d?.value && !colorMode.forced) { + if (d?.value && notUsingInput.value && !colorMode.forced) { // Swap theme from dark to light or vice versa if (colorMode.value === "dark") { colorMode.preference = "light";