Minor changes (help to read)
parent
d37b3d536f
commit
cbbf602552
|
@ -23,7 +23,7 @@ class Checkbox extends React.Component {
|
|||
|
||||
handleClick = (event) => {
|
||||
events.pauseEvent(event);
|
||||
if (!this.props.disabled) this.props.onChange(event);
|
||||
this.props.onChange(event);
|
||||
};
|
||||
|
||||
handleInputClick = (event) => {
|
||||
|
@ -31,7 +31,7 @@ class Checkbox extends React.Component {
|
|||
};
|
||||
|
||||
handleMouseDown = (event) => {
|
||||
if (!this.props.disabled) this.refs.ripple.start(event);
|
||||
this.refs.ripple.start(event);
|
||||
};
|
||||
|
||||
render () {
|
||||
|
@ -51,10 +51,14 @@ class Checkbox extends React.Component {
|
|||
ref='input'
|
||||
{...this.props}
|
||||
className={style.input}
|
||||
onClick={this.handleInputClick}
|
||||
onClick={(this.props.onChange && !this.props.disabled) ? this.handleInputClick : null}
|
||||
type='checkbox'
|
||||
/>
|
||||
<span data-role='checkbox' className={checkboxClassName} onMouseDown={this.handleMouseDown}>
|
||||
<span
|
||||
data-role='checkbox'
|
||||
className={checkboxClassName}
|
||||
onMouseDown={!this.props.disabled ? this.handleMouseDown : null}
|
||||
>
|
||||
<Ripple ref='ripple' data-role='ripple' className={style.ripple} spread={3} centered />
|
||||
</span>
|
||||
{ this.props.label ? <span data-role='label' className={style.text}>{this.props.label}</span> : null }
|
||||
|
|
Loading…
Reference in New Issue