From 03b6e7900be2176c5c0f2f9e82cbb32fe8630130 Mon Sep 17 00:00:00 2001
From: wxiaoguang <wxiaoguang@gmail.com>
Date: Mon, 17 Apr 2023 19:02:09 +0800
Subject: [PATCH] Use 1.18's aria role for dropdown menus (#24144) (#24155)

Backport #24144

Co-authored-by: silverwind <me@silverwind.io>
---
 web_src/js/features/aria.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/web_src/js/features/aria.js b/web_src/js/features/aria.js
index 676f4cd56c..2f3ab1acd2 100644
--- a/web_src/js/features/aria.js
+++ b/web_src/js/features/aria.js
@@ -34,8 +34,8 @@ function attachOneDropdownAria($dropdown) {
   // Since #19861 we have prepared the "combobox" solution, but didn't get enough time to put it into practice and test before.
   const isComboBox = $dropdown.find('input').length > 0;
 
-  const focusableRole = isComboBox ? 'combobox' : 'button';
-  const listPopupRole = isComboBox ? 'listbox' : 'menu';
+  const focusableRole = isComboBox ? 'combobox' : 'menu';
+  const listPopupRole = isComboBox ? 'listbox' : '';
   const listItemRole = isComboBox ? 'option' : 'menuitem';
 
   // make the item has role=option/menuitem, add an id if there wasn't one yet, make items as non-focusable