Procházet zdrojové kódy

feat(a11y): overflowlist aria

zwlafk před 3 roky
rodič
revize
ea0a811d05
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      packages/semi-ui/overflowList/index.tsx

+ 4 - 0
packages/semi-ui/overflowList/index.tsx

@@ -228,6 +228,7 @@ class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
                         }}
                         style={{ ...wrapperStyle }}
                         key={`${prefixCls}-scroll-wrapper`}
+                        role="presentation"
                     >
                         {visible.map(visibleItemRenderer).map((item: ReactElement, ind) => {
                             const { forwardRef, key } = item as any;
@@ -235,6 +236,7 @@ class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
                                 ref: (node: any) => this.mergeRef(forwardRef, node, key),
                                 'data-scrollkey': `${key}`,
                                 key,
+                                role: 'listitem'
                             });
                         })}
                     </div>,
@@ -251,6 +253,8 @@ class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
             {
                 className: cls(`${prefixCls}`, className),
                 style,
+                role: 'list',
+                "aria-orientation": 'horizontal'
             },
             ...inner
         );