Skip to content

Commit da2122d

Browse files
authored
fix: set aria-label on the correct CRUD filter element (#9608)
## Description Updated `CrudGrid` to use `setAriaLabel()` instead of `setAttribute("aria-label")`. This makes `aria-label` set on the `<input>` element as expected. ### Before <img width="587" height="245" alt="Screenshot 2026-06-24 at 13 06 33" src="https://github.com/user-attachments/assets/20fd972b-31cd-4830-85b4-5098a921fa5d" /> ### After <img width="619" height="173" alt="Screenshot 2026-06-24 at 13 05 24" src="https://github.com/user-attachments/assets/2d2d0bd5-9aa2-48a1-9fbd-f179d8232ede" /> ## Type of change - Bugfix
1 parent e044e51 commit da2122d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • vaadin-crud-flow-parent
    • vaadin-crud-flow-integration-tests/src/test/java/com/vaadin/flow/component/crud/tests
    • vaadin-crud-flow/src/main/java/com/vaadin/flow/component/crud

vaadin-crud-flow-parent/vaadin-crud-flow-integration-tests/src/test/java/com/vaadin/flow/component/crud/tests/BasicUseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void sorterHasAriaLabel() {
9898
public void filterHasAriaLabel() {
9999
CrudElement crud = $(CrudElement.class).waitForFirst();
100100
Assert.assertEquals("Filter by First Name",
101-
crud.getFilterFields().get(0).getDomAttribute("aria-label"));
101+
crud.getFilterFields().get(0).getDomProperty("accessibleName"));
102102
}
103103

104104
@Test

vaadin-crud-flow-parent/vaadin-crud-flow/src/main/java/com/vaadin/flow/component/crud/CrudGrid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private void setupFiltering() {
7373
getColumns().forEach(column -> {
7474
final TextField field = new TextField();
7575
field.getElement().setAttribute("crud-role", "Search");
76-
field.getElement().setAttribute("aria-label", "Filter by "
76+
field.setAriaLabel("Filter by "
7777
+ SharedUtil.propertyIdToHumanFriendly(column.getKey()));
7878

7979
field.addValueChangeListener(event -> {

0 commit comments

Comments
 (0)