-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: fix aria-* attirbutes #137
Conversation
src/MenuItem.jsx
Outdated
'aria-disabled': props.disabled, | ||
...props.attribute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 prop.attribute
好像文档里也没写,不知道哪里用的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我加一下吧,感觉只有在rc-select里有用,而且确实名字也挺含糊的。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实感觉也是没什么用?因为之前是不能通过 props 给 li 传 props,但是 #135 就不需要这个属性了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看了一下,现在readme.md里Menu.Item的props跟实际上的差很多,这个attribute又感觉优点随机,我加到PropTypes的声明里了
src/MenuItem.jsx
Outdated
role: 'option', | ||
'aria-selected': props.isSelected, | ||
} | ||
} else if (attrs.role === 'null') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
@@ -316,8 +316,8 @@ export class SubPopupMenu extends React.Component { | |||
); | |||
const domProps = { | |||
className, | |||
role: 'menu', | |||
'aria-activedescendant': '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考: dequelabs/axe-core#179
aria-activedescendant空字符串非法
@@ -181,11 +195,11 @@ export class MenuItem extends React.Component { | |||
} | |||
} | |||
|
|||
MenuItem.isMenuItem = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上次忘记改了
这个也合掉? |
看了一下 |
ant-design/ant-design#10095
The idea is to fix the area-* attributes issue and avoid any breaking changes
before:
after: