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

School dropdown flexibility #20705

Merged
merged 4 commits into from Feb 19, 2018
Merged

School dropdown flexibility #20705

merged 4 commits into from Feb 19, 2018

Conversation

drewsamnick
Copy link
Contributor

I'm working in changes to the /yourschool page that will add the ability to search for your school and then highlight that school on the map. The school you find via the search will also be set as the selection of the dropdown in the census form on the page. This requires three new features:

  1. Ability to filter schools from the dropdown (in my case I will be filtering out schools without lat/long data since we can't show them on the map.)
  2. Providing the full school object in the data passed to the onChange function. I've also added lat/long into the data returned by the API. This is to avoid making another API call to reload the same data.
  3. It turns out that the loadOptions function passed into VirtualizedSelect is only called when the component is initially constructed and when the user types into the field. It is not called when the value prop gets a new value. That means that if you set value to something that has not already been returned by loadOptions then it won't select anything (since that isn't in the list of loaded options.) However, if you set value to a full option object then it will be used and that option will be selected. In order to set the value of the dropdown in the census form based on the selection from the map dropdown I need to be able to pass a full option.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

👍

@drewsamnick drewsamnick merged commit d06d459 into staging Feb 19, 2018
@drewsamnick drewsamnick deleted the school-dropdown-flexibility branch February 19, 2018 17:42
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.

None yet

2 participants