1
0
Эх сурвалжийг харах

fix: tabindex is transparently passed to tag in any case (#1461)

YannLynn 2 жил өмнө
parent
commit
466abf8c96

+ 2 - 1
packages/semi-ui/tag/index.tsx

@@ -126,10 +126,11 @@ export default class Tag extends Component<TagProps, TagState> {
         const { visible: isVisible } = this.state;
         const clickable = onClick !== Tag.defaultProps.onClick || closable;
         // only when the Tag is clickable or closable, the value of tabIndex is allowed to be passed in. 
-        const a11yProps = { role: 'button', tabIndex: tabIndex | 0, onKeyDown: this.handleKeyDown };
+        const a11yProps = { role: 'button', tabIndex: tabIndex || 0, onKeyDown: this.handleKeyDown };
         const baseProps = {
             ...attr,
             onClick,
+            tabIndex: tabIndex,
             className: classNames(
                 prefixCls,
                 {