Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update picker properly on parent value #8698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Picker/BasePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BasePicker extends React.Component {
super(props);

this.state = {
selectedValue: this.props.value || this.props.defaultValue,
selectedValue: this.props.defaultValue,
luacmartins marked this conversation as resolved.
Show resolved Hide resolved
};

this.updateSelectedValueAndExecuteOnChange = this.updateSelectedValueAndExecuteOnChange.bind(this);
Expand All @@ -31,7 +31,7 @@ class BasePicker extends React.Component {
style={this.props.size === 'normal' ? basePickerStyles(this.props.disabled, hasError, this.props.focused) : styles.pickerSmall}
useNativeAndroidPickerStyle={false}
placeholder={this.props.placeholder}
value={this.state.selectedValue}
value={this.props.value || this.state.selectedValue}
Icon={() => this.props.icon(this.props.size)}
disabled={this.props.disabled}
fixAndroidTouchableBug
Expand Down
1 change: 0 additions & 1 deletion src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ class ProfilePage extends Component {
items={timezones}
isDisabled={this.state.isAutomaticTimezone}
value={this.state.selectedTimezone}
key={`timezonePicker-${this.state.isAutomaticTimezone}`}
/>
</View>
<CheckboxWithLabel
Expand Down