Skip to content

Commit 9ec8898

Browse files
Fix excess scroll bug in dataframe (#10802)
* fix excess scroll * add changeset * fix test * fix test --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
1 parent 997ecb4 commit 9ec8898

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.changeset/dirty-peaches-leave.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@gradio/dataframe": minor
3+
"gradio": minor
4+
---
5+
6+
feat:Fix excess scroll bug in dataframe

js/dataframe/shared/EditableCell.svelte

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@
104104

105105
{#if edit}
106106
<input
107-
disabled={is_static}
108-
aria-disabled={is_static}
109-
class:static={is_static}
107+
readonly={is_static}
108+
aria-readonly={is_static}
110109
role="textbox"
111110
aria-label={is_static ? "Cell is read-only" : "Edit cell"}
112111
bind:this={el}
@@ -131,7 +130,6 @@
131130
class:edit
132131
class:expanded={is_expanded}
133132
class:multiline={header}
134-
class:static={!editable}
135133
on:focus|preventDefault
136134
style={styling}
137135
data-editable={editable}
@@ -188,6 +186,7 @@
188186
border: none;
189187
background: transparent;
190188
cursor: text;
189+
width: calc(100% - var(--size-2));
191190
}
192191
193192
span {
@@ -241,7 +240,7 @@
241240
object-fit: contain;
242241
}
243242
244-
input:disabled {
243+
input:read-only {
245244
cursor: not-allowed;
246245
}
247246
</style>

js/spa/test/dataframe_events.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ test("Static columns cannot be edited", async ({ page }) => {
279279
await page.waitForTimeout(100);
280280

281281
const is_disabled =
282-
(await static_column_cell.locator("input").getAttribute("disabled")) !==
282+
(await static_column_cell.locator("input").getAttribute("readonly")) !==
283283
null;
284284
expect(is_disabled).toBe(true);
285285

@@ -289,7 +289,7 @@ test("Static columns cannot be edited", async ({ page }) => {
289289

290290
const is_not_disabled = await editable_cell
291291
.locator("input")
292-
.getAttribute("aria-disabled");
292+
.getAttribute("aria-readonly");
293293
expect(is_not_disabled).toEqual("false");
294294
});
295295

0 commit comments

Comments
 (0)