Skip to content

Fix/picker get label #1059

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

Merged
merged 3 commits into from
Dec 10, 2020
Merged

Fix/picker get label #1059

merged 3 commits into from
Dec 10, 2020

Conversation

mendyEdri
Copy link
Contributor

Description

Fixed getLabel property issue on multi-select mode.

Changelog

Fixed getLabel property issue on Picker's multi-select mode.

@mendyEdri mendyEdri requested a review from ethanshar December 3, 2020 08:23
Comment on lines 227 to 230
getLabelValueText = () => {
const {value: propsValue} = this.props;
const {value: stateValue} = this.props;

if (this.shouldNotChangePickerLabelWhileSelecting()) {
return this.getLabel(propsValue);
}
return this.getLabel(stateValue);
const {value} = this.props;
return this.getLabel(value);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that now getLabelValueText is redundant..
it's just a wrapper of this.getLabel.
Can we remove it?

Copy link
Contributor Author

@mendyEdri mendyEdri Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, It's just since there are value deconstruction that needs to be repeated for a few times in this class, maybe it's still valid?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was valid before when you had some logic there..
But now we use it only in one place and all it does it extract the value prop. Which seems a little redundant, no?

@ethanshar ethanshar merged commit 5930ea5 into master Dec 10, 2020
@mendyEdri mendyEdri deleted the fix/picker-getLabel branch December 14, 2020 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants