Skip to content

Commit

Permalink
[fixed] stop rendering extra attributes on Progress bar dom nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense authored and AlexKVal committed Aug 28, 2015
1 parent 02f1fec commit deee09d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/ProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ const ProgressBar = React.createClass({
}

return (
<div {...this.props} className={classNames(this.props.className, 'progress')}>
<div
{...this.props}
className={classNames(this.props.className, 'progress')}
min={null}
max={null}
label={null}
aria-valuetext={null}
>
{content}
</div>
);
Expand All @@ -73,18 +80,14 @@ const ProgressBar = React.createClass({
},

renderProgressBar() {
let { className, label, now, min, max, ...props } = this.props;

const percentage = this.getPercentage(
this.props.now,
this.props.min,
this.props.max
now, min, max
);

let label;

if (typeof this.props.label === 'string') {
if (typeof label === 'string') {
label = this.renderLabel(percentage);
} else {
label = this.props.label;
}

if (this.props.srOnly) {
Expand All @@ -95,17 +98,17 @@ const ProgressBar = React.createClass({
);
}

const classes = classNames(this.props.className, this.getBsClassSet(), {
const classes = classNames(className, this.getBsClassSet(), {
active: this.props.active,
'progress-bar-striped': this.props.active || this.props.striped
});

return (
<div
{...this.props}
{...props}
className={classes}
role="progressbar"
style={{width: percentage + '%'}}
style={{ width: percentage + '%' }}
aria-valuenow={this.props.now}
aria-valuemin={this.props.min}
aria-valuemax={this.props.max}>
Expand Down

0 comments on commit deee09d

Please sign in to comment.