소스 검색

Fixes #22530: Remove hidden select inputs from the accessibility tree (#22541)

Jeremy Stretch 1 주 전
부모
커밋
4f4e97f1a6
3개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 0 0
      netbox/project-static/dist/netbox.js
  2. 0 0
      netbox/project-static/dist/netbox.js.map
  3. 12 0
      netbox/project-static/src/select/classes/netboxTomSelect.ts

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
netbox/project-static/dist/netbox.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
netbox/project-static/dist/netbox.js.map


+ 12 - 0
netbox/project-static/src/select/classes/netboxTomSelect.ts

@@ -18,6 +18,18 @@ import TomSelect from 'tom-select';
  * NetBox issue:  https://github.com/netbox-community/netbox/issues/20077
  */
 export class NetBoxTomSelect extends TomSelect {
+  setup(): void {
+    super.setup();
+
+    // After TomSelect takes over, the original <select> is visually hidden via the
+    // `ts-hidden-accessible` class and made unfocusable (tabindex=-1), but it remains in the
+    // accessibility tree. Screen readers (e.g. JAWS) then announce a stray listbox/combobox for
+    // every enhanced field. The TomSelect-rendered control already exposes an accessible
+    // combobox, so hide the redundant native element from assistive technology.
+    // See https://github.com/netbox-community/netbox/issues/22530
+    this.input.setAttribute('aria-hidden', 'true');
+  }
+
   focus(): void {
     if (this.isDisabled || this.isReadOnly) return;
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.