Skip to content

Commit

Permalink
Merge pull request react-bootstrap#1245 from react-bootstrap/progress…
Browse files Browse the repository at this point in the history
…-attr-cleanup

[fixed] stop rendering extra attributes on Progress bar dom nodes
  • Loading branch information
taion committed Aug 28, 2015
2 parents 8b1f2a1 + c450e96 commit 6a8ed3e
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 6a8ed3e

Please sign in to comment.