Skip to content

Commit 696bbf1

Browse files
committed
another attempt at button editor bugs
1 parent 02e623e commit 696bbf1

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

packages/core/src/fields/inputFields/fields/Editor/EditorComponent.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<textarea bind:value={value} onfocusout={() => focusOut()} oninput={() => props.onValueChange(value)}
4141
></textarea>
4242
{:else}
43-
<MarkdownRenderComponent bind:value={value} plugin={props.plugin} filePath={props.filePath}
43+
<MarkdownRenderComponent value={value} plugin={props.plugin} filePath={props.filePath}
4444
></MarkdownRenderComponent>
4545
{/if}
4646
</div>

packages/core/src/fields/inputFields/fields/Editor/MarkdownRenderComponent.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let element: HTMLElement;
66
77
const {
8-
value = $bindable(''),
8+
value,
99
plugin,
1010
filePath,
1111
}: {
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<script lang="ts">
22
let {
3-
checked = $bindable(false),
3+
checked = $bindable(),
44
}: {
55
checked?: boolean;
66
} = $props();
7+
8+
let boolChecked = $derived(checked ?? false);
79
</script>
810

911
<div
1012
class="checkbox-container"
11-
class:is-enabled={checked}
13+
class:is-enabled={boolChecked}
1214
role="switch"
1315
tabindex="0"
14-
aria-checked={checked}
15-
onclick={() => (checked = !checked)}
16+
aria-checked={boolChecked}
17+
onclick={() => (checked = !boolChecked)}
1618
onkeydown={e => {
1719
if (e.key === ' ') {
18-
checked = !checked;
20+
checked = !boolChecked;
1921
}
2022
}}
2123
>
22-
<input type="checkbox" tabindex="-1" checked={checked} />
24+
<input type="checkbox" tabindex="-1" checked={boolChecked} />
2325
</div>

0 commit comments

Comments
 (0)