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

DRY up selector defaulting #88

Open
rod-glover opened this issue Apr 2, 2020 · 0 comments
Open

DRY up selector defaulting #88

rod-glover opened this issue Apr 2, 2020 · 0 comments
Labels
Milestone

Comments

@rod-glover
Copy link
Contributor

Components VariableSelector, TimePeriodSelector, SeasonSelector, and RegionSelector all do generically the same thing to select a default value. However they do this same thing somewhat differently in each case, and this is unnecessarily complicated and confusing.

The generic thing is that they use replaceInvalidValue to select one of the selector's options (derived internally in each selector) when there is an invalid value (usually undefined) for the selector. This makes defaulting easy and quick. The option matching function should be abstracted out to a single, common function, which might profitably be migrated back into component pcic-react-components.

@rod-glover rod-glover added this to the Code cleanup milestone May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant