Skip to content

Commit d692e36

Browse files
author
Sibtain Ali
committed
feat(#67): Fixed a small glitch.
1 parent f9849f9 commit d692e36

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default class ModalSelector extends React.Component {
148148
let newState = {};
149149
let doUpdate = false;
150150
if (prevProps.initValue !== this.props.initValue) {
151-
newState.selected = this.props.initValue;
151+
newState.selected = [this.props.initValue];
152152
doUpdate = true;
153153
}
154154
if (prevProps.visible !== this.props.visible) {
@@ -356,8 +356,7 @@ export default class ModalSelector extends React.Component {
356356
if (this.props.children) {
357357
return this.props.children;
358358
}
359-
let initSelectStyle =
360-
this.props.initValue === this.state.selected
359+
let initSelectStyle = this.state.selected.find(this.state.initValue)
361360
? [styles.initValueTextStyle, this.props.initValueTextStyle]
362361
: [styles.selectTextStyle, this.props.selectTextStyle];
363362
return (

0 commit comments

Comments
 (0)