From 6385301d76d6b693f6b1e3214d7145c60476a3dc Mon Sep 17 00:00:00 2001 From: siddhantantil39 Date: Fri, 3 Jan 2025 01:20:25 +0530 Subject: [PATCH 1/4] [material-ui][Select] Aria-controls references invalid id when not expanded #43876 --- packages/mui-material/src/Select/Select.test.js | 5 +++++ packages/mui-material/src/Select/SelectInput.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/mui-material/src/Select/Select.test.js b/packages/mui-material/src/Select/Select.test.js index 4d6817f9ad0c13..bd7b5c3f41d96c 100644 --- a/packages/mui-material/src/Select/Select.test.js +++ b/packages/mui-material/src/Select/Select.test.js @@ -487,6 +487,11 @@ describe('); + expect(getByRole('combobox', { hidden: true })).to.have.attribute('aria-controls', ''); + }); + specify('the listbox is focusable', async () => { const { getByRole } = render(', () => { it('indicates that input element has combobox role and aria-controls set to "" when in a non-open state', () => { const { getByRole } = render(', () => { expect(getByRole('combobox', { hidden: true })).to.have.attribute('aria-controls', listboxId); }); - it('indicates that input element has combobox role and aria-controls set to "" when in a non-open state', () => { + it('does not set aria-controls when closed', () => { const { getByRole } = render(