Fix unexpected rendering of Dataset (#8987)

* Fix unexpected rendering of Dataset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
Col0ring 2024-08-10 00:06:56 +08:00 committed by GitHub
parent 54da6da115
commit 7b288cf677
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/dataset": patch
"gradio": patch
---
fix:Fix unexpected rendering of Dataset

View File

@ -53,7 +53,11 @@
}
$: {
samples = sample_labels ? sample_labels.map((e) => [e]) : samples || [];
if (sample_labels) {
samples = sample_labels.map((e) => [e]);
} else if (!samples) {
samples = [];
}
paginate = samples.length > samples_per_page;
if (paginate) {
visible_pages = [];