Fix error when scrolling dropdown with scrollbar (#5839)

* Fix error when scrolling dropdown with scrollbar

* added comment

* add changeset

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Kit PANG 2023-10-09 09:34:05 +08:00 committed by GitHub
parent 1d5b15a2d2
commit b83064da00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/dropdown": patch
"gradio": patch
---
fix:Fix error when scrolling dropdown with scrollbar

View File

@ -117,6 +117,11 @@
function handle_option_selected(e: any): void {
selected_index = parseInt(e.detail.target.dataset.index);
if (isNaN(selected_index)) {
// This is the case when the user clicks on the scrollbar
selected_index = null;
return;
}
show_options = false;
active_index = null;
filter_input.blur();