Skip to content

Commit e7b4f23

Browse files
author
Ian Wensink
committed
feat(styled-components): fix non-boolean attribute warning
1 parent 8efeabb commit e7b4f23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BaseInput/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import WebformElement from '../WebformElement';
66
// styled
77
import Input from './styled/input';
88

9+
const StyledInputMask = Input.withComponent(({ error, ...p }) => <InputMask {...p} />);
10+
911
@observer
1012
class BaseInput extends Component {
1113
static propTypes = {
@@ -78,7 +80,7 @@ class BaseInput extends Component {
7880

7981
// When there is a mask from Drupal.
8082
if(this.props.field['#mask']) {
81-
InputComponent = Input.withComponent(InputMask); // Use InputMask element instead.
83+
InputComponent = StyledInputMask; // Use InputMask element instead.
8284
attrs.mask = this.props.field['#mask'];
8385
attrs.alwaysShowMask = this.props.field['#alwaysShowMask'] || true;
8486
}
@@ -90,7 +92,7 @@ class BaseInput extends Component {
9092
name={this.props.field['#webform_key']}
9193
id={this.props.id || this.props.field['#webform_key']}
9294
placeholder={this.props.field['#placeholder']}
93-
error={(!this.props.webformElement.isValid()).toString()}
95+
error={!this.props.webformElement.isValid()}
9496
className={this.props.className}
9597
min={this.props.field['#min']}
9698
max={this.props.field['#max']}

0 commit comments

Comments
 (0)