diff --git a/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte
new file mode 100644
index 0000000..68705fb
--- /dev/null
+++ b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
+
diff --git a/src/shared/ui/ContentEditable/ContentEditable.svelte b/src/shared/ui/ContentEditable/ContentEditable.svelte
index 15508ef..0c9bc0b 100644
--- a/src/shared/ui/ContentEditable/ContentEditable.svelte
+++ b/src/shared/ui/ContentEditable/ContentEditable.svelte
@@ -7,7 +7,7 @@ interface Props {
/**
* Visible text
*/
- text?: string;
+ text: string;
/**
* Font settings
*/
@@ -17,19 +17,38 @@ interface Props {
}
let {
- text = 'The quick brown fox jumps over the lazy dog',
+ text = $bindable('The quick brown fox jumps over the lazy dog.'),
fontSize = 48,
lineHeight = 1.2,
letterSpacing = 0,
}: Props = $props();
+
+let element: HTMLDivElement | undefined = $state();
+
+// Initial Sync: Set the text ONLY ONCE when the element is created.
+// This prevents Svelte from "owning" the innerHTML/innerText.
+$effect(() => {
+ if (element && element.innerText !== text) {
+ element.innerText = text;
+ }
+});
+
+// Handle changes: Update the outer state without re-rendering the div.
+function handleInput(e: Event) {
+ const target = e.target as HTMLDivElement;
+ // Update the bindable prop directly
+ text = target.innerText;
+}
- {text}