Skip to content

Commit

Permalink
Multimodal autofocus fix (#10168)
Browse files Browse the repository at this point in the history
* autofocus

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
dawoodkhan82 and gradio-pr-bot authored Dec 11, 2024
1 parent 8ac5b13 commit 7d70596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/brave-plants-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/multimodaltextbox": patch
"gradio": patch
---

fix:Multimodal autofocus fix
6 changes: 5 additions & 1 deletion js/multimodaltextbox/shared/MultimodalTextbox.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import {
onMount,
beforeUpdate,
afterUpdate,
createEventDispatcher,
Expand Down Expand Up @@ -102,10 +103,13 @@
}
}
afterUpdate(() => {
onMount(() => {
if (autofocus && el !== null) {
el.focus();
}
});
afterUpdate(() => {
if (can_scroll && autoscroll) {
scroll();
}
Expand Down

0 comments on commit 7d70596

Please sign in to comment.