Skip to content

Commit ac3e7cc

Browse files
committed
fix: input file button
1 parent f3e0396 commit ac3e7cc

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

platforms/metagram/src/lib/fragments/MessageInput/MessageInput.svelte

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
...restProps
2727
}: IMessageInputProps = $props();
2828
29+
let fileInput: HTMLInputElement | undefined = $state();
30+
2931
const cBase = 'flex items-center justify-between gap-2';
3032
</script>
3133

@@ -56,14 +58,25 @@
5658
</div>
5759
{:else}
5860
<div class="bg-grey flex aspect-square h-13 w-13 items-center justify-center rounded-full">
59-
<input id="add-image" type="file" class="hidden" accept="image/*" bind:files />
61+
<input
62+
id="add-image"
63+
type="file"
64+
class="hidden"
65+
accept="image/*"
66+
bind:files
67+
bind:this={fileInput}
68+
/>
6069
<button
6170
type="button"
6271
class="bg-grey flex aspect-square h-13 w-13 items-center justify-center rounded-full border-0 p-0"
63-
onclick={handleSend}
64-
aria-label="Send message"
72+
aria-label="add-image"
73+
onclick={() => fileInput?.click()}
6574
>
66-
<HugeiconsIcon size="24px" icon={ImageCompositionOvalIcon} color="var(--color-black-400)" />
75+
<HugeiconsIcon
76+
size="24px"
77+
icon={ImageCompositionOvalIcon}
78+
color="var(--color-black-400)"
79+
/>
6780
</button>
6881
</div>
6982
{/if}

0 commit comments

Comments
 (0)