Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(screen-reader): disable FileDropZone area-label for models without file upload #1295

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/lib/components/chat/ChatWindow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
: []),
...(currentModel.multimodal ? ["image/*"] : []),
];
$: isFileUploadEnabled = activeMimeTypes.length > 0;
</script>

<div class="relative min-h-0 min-w-0">
Expand Down Expand Up @@ -312,7 +314,7 @@
/>
{:else}
<div class="ml-auto gap-2">
{#if activeMimeTypes.length > 0}
{#if isFileUploadEnabled}
<UploadBtn bind:files mimeTypes={activeMimeTypes} classNames="ml-auto" />
{/if}
{#if messages && lastMessage && lastMessage.interrupted && !isReadOnly}
Expand All @@ -334,12 +336,12 @@
on:dragenter={onDragEnter}
on:dragleave={onDragLeave}
tabindex="-1"
aria-label="file dropzone"
aria-label={isFileUploadEnabled ? "file dropzone" : undefined}
on:submit|preventDefault={handleSubmit}
class="relative flex w-full max-w-4xl flex-1 items-center rounded-xl border bg-gray-100 focus-within:border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:focus-within:border-gray-500
{isReadOnly ? 'opacity-30' : ''}"
>
{#if onDrag && activeMimeTypes.length > 0}
{#if onDrag && isFileUploadEnabled}
<FileDropzone bind:files bind:onDrag mimeTypes={activeMimeTypes} />
{:else}
<div class="flex w-full flex-1 border-none bg-transparent">
Expand Down
Loading