|
388 | 388 | />
|
389 | 389 | {/if}
|
390 | 390 | <div class="input-container">
|
391 |
| - {#if sources && sources.includes("upload") && !disabled && !(file_count === "single" && value.files.length > 0)} |
| 391 | + {#if sources && sources.includes("upload") && !(file_count === "single" && value.files.length > 0)} |
392 | 392 | <Upload
|
393 | 393 | bind:this={upload_component}
|
394 | 394 | on:load={handle_upload}
|
|
409 | 409 | <button
|
410 | 410 | data-testid="upload-button"
|
411 | 411 | class="upload-button"
|
412 |
| - on:click={handle_upload_click}><Paperclip /></button |
| 412 | + {disabled} |
| 413 | + on:click={disabled ? undefined : handle_upload_click} |
| 414 | + ><Paperclip /></button |
413 | 415 | >
|
414 | 416 | {/if}
|
415 | 417 | {#if sources && sources.includes("microphone")}
|
416 | 418 | <button
|
417 | 419 | data-testid="microphone-button"
|
418 | 420 | class="microphone-button"
|
419 | 421 | class:recording
|
420 |
| - on:click={() => { |
421 |
| - active_source = active_source !== "microphone" ? "microphone" : null; |
422 |
| - }} |
| 422 | + {disabled} |
| 423 | + on:click={disabled |
| 424 | + ? undefined |
| 425 | + : () => { |
| 426 | + active_source = |
| 427 | + active_source !== "microphone" ? "microphone" : null; |
| 428 | + }} |
423 | 429 | >
|
424 | 430 | <Microphone />
|
425 | 431 | </button>
|
|
453 | 459 | <button
|
454 | 460 | class="submit-button"
|
455 | 461 | class:padded-button={submit_btn !== true}
|
456 |
| - on:click={handle_submit} |
| 462 | + {disabled} |
| 463 | + on:click={disabled ? undefined : handle_submit} |
457 | 464 | >
|
458 | 465 | {#if submit_btn === true}
|
459 | 466 | <Send />
|
|
567 | 574 | background: var(--button-secondary-background-fill);
|
568 | 575 | }
|
569 | 576 |
|
570 |
| - .microphone-button:hover, |
571 |
| - .stop-button:hover, |
572 |
| - .upload-button:hover, |
573 |
| - .submit-button:hover { |
| 577 | + .microphone-button:hover:not(:disabled), |
| 578 | + .stop-button:hover:not(:disabled), |
| 579 | + .upload-button:hover:not(:disabled), |
| 580 | + .submit-button:hover:not(:disabled) { |
574 | 581 | background: var(--button-secondary-background-fill-hover);
|
575 | 582 | }
|
576 | 583 |
|
|
579 | 586 | .upload-button:disabled,
|
580 | 587 | .submit-button:disabled {
|
581 | 588 | background: var(--button-secondary-background-fill);
|
582 |
| - cursor: initial; |
| 589 | + cursor: not-allowed; |
583 | 590 | }
|
584 | 591 | .microphone-button:active,
|
585 | 592 | .stop-button:active,
|
|
0 commit comments