-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
support aria #260
support aria #260
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,23 @@ import PropTypes from 'prop-types'; | |
export default class Handle extends React.Component { | ||
render() { | ||
const { | ||
className, vertical, offset, handleStyle, ...restProps, | ||
className, vertical, offset, handleStyle, disabled, min, max, value, ...restProps, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里会导致下面的 handle div 少一个 disabled 属性吧 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. div 不应该有 disabled 属性吧 @paranoidjk There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 恩,是的,看来是之前的代码有bug,那这里会导致snapshot都要更新了 |
||
} = this.props; | ||
const style = vertical ? { bottom: `${offset}%` } : { left: `${offset}%` }; | ||
|
||
const elStyle = { | ||
...style, | ||
...handleStyle, | ||
}; | ||
return <div {...restProps} className={className} style={elStyle} />; | ||
const style = vertical ? { bottom: `${offset}%` } : { left: `${offset}%` }; | ||
const elStyle = { ...style, ...handleStyle }; | ||
return ( | ||
<div | ||
role="slider" | ||
aria-valuemin={min} | ||
aria-valuemax={max} | ||
aria-valuenow={value} | ||
aria-disabled={disabled} | ||
{...restProps} | ||
className={className} | ||
style={elStyle} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
|
@@ -21,4 +29,8 @@ Handle.propTypes = { | |
vertical: PropTypes.bool, | ||
offset: PropTypes.number, | ||
handleStyle: PropTypes.object, | ||
disabled: PropTypes.bool, | ||
min: PropTypes.number, | ||
max: PropTypes.number, | ||
value: PropTypes.number, | ||
}; |
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 少个value,break change,rc-slider 要发大版本。
到 ant-design 那边也提个PR WIP 修下吧
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#6301