DataGrid - TextArea editor should have the aria-invalid attribute when invalid (T1296376)#32801
DataGrid - TextArea editor should have the aria-invalid attribute when invalid (T1296376)#32801markallenramirez wants to merge 10 commits intoDevExpress:26_1from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an accessibility bug (T1296376) where a DataGrid cell using a dxTextArea editor did not receive the aria-invalid attribute when its value failed validation. The fix works by extending the EDITORS_INPUT_SELECTOR in const.ts to also match <textarea> elements, enabling the existing validation-aria-attribute logic in m_validating.ts to find and annotate the textarea.
Changes:
- Extends
EDITORS_INPUT_SELECTORinconst.tsto includetextarea:not([hidden])alongside the existinginput:not([type='hidden']). - Adds a TestCafe E2E test in
bugs.tsthat verifies thearia-invalidattribute is set on adxTextAreaeditor after a required-field validation failure.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/devextreme/js/__internal/grids/grid_core/editing/const.ts |
Extends EDITORS_INPUT_SELECTOR to include textarea elements (excluding those with the HTML hidden attribute) |
e2e/testcafe-devextreme/tests/dataGrid/common/accessibility/bugs.ts |
Adds a new TestCafe test verifying aria-invalid="true" is set on the dxTextArea editor after validation failure |
| await t | ||
| .expect(dataGrid.isReady()) | ||
| .ok() | ||
| .expect(dataCell.getEditor().element.getAttribute('aria-invalid')) |
There was a problem hiding this comment.
The test calls dataCell.getEditor() which likely returns the editor for an input element by default, but this test is specifically verifying that a textarea element has the aria-invalid attribute. If getEditor() returns a selector scoped to an input, the test may not actually be asserting the aria-invalid attribute on the textarea element as intended. It would be clearer and more correct to directly select the textarea element within the cell to verify the attribute.
| .expect(dataCell.getEditor().element.getAttribute('aria-invalid')) | |
| .expect(dataCell.element.find('textarea').getAttribute('aria-invalid')) |
This reverts commit 6d3fb7d.
No description provided.