Skip to content

Commit 34fdd33

Browse files
committed
fix(ui5-table-row): Prevent space when target is tr
FIXES: #3390
1 parent c94301a commit 34fdd33

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/main/src/TableRow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class TableRow extends UI5Element {
182182
const isRowFocused = this._getActiveElementTagName() === "ui5-table-row";
183183
const checkboxPressed = event.target.classList.contains("ui5-multi-select-checkbox");
184184

185-
if (isSpace(event)) {
185+
if (isSpace(event) && event.target.tagName.toLowerCase() === "tr") {
186186
event.preventDefault();
187187
}
188188

packages/main/test/specs/Table.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -425,5 +425,19 @@ describe("Table general interaction", () => {
425425
assert.strictEqual(selectionChangeCount.getProperty("value"), "", "Space key over a row in a default mode table should not trigger selection-change event");
426426
assert.strictEqual(rowClickCount.getProperty("value"), "2", "Space key over an Inctive row should not trigger row-click event");
427427
});
428+
429+
it ("tests adding spaces to input fields in a row", () => {
430+
browser.url(`http://localhost:${PORT}/test-resources/pages/Table.html`);
431+
432+
const input = $("#myInput");
433+
const inner = input.shadow$("input");
434+
435+
inner.click();
436+
inner.keys("a");
437+
inner.keys("Space");
438+
inner.keys("b");
439+
440+
assert.strictEqual(inner.getValue(), "a b", "space should be visible");
441+
});
428442
});
429443
});

0 commit comments

Comments
 (0)