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

Select component warning on submit #300

Open
mariekers opened this issue May 12, 2020 · 3 comments
Open

Select component warning on submit #300

mariekers opened this issue May 12, 2020 · 3 comments
Assignees
Labels
javascript Pull requests that update Javascript code material-ui react

Comments

@mariekers
Copy link
Collaborator

When form data is submitted and the server sends a successful post response for a visit,
visit.service and visit.program goes from an id (integer) to an object. This throws a Material-UI select warning because an object is not an expected value.

2 possible solutions:

  1. hold two different state objects for the visit in mobx, one for form data/input and one for current visit/responses
  2. useState for onChange values inside the component itself. this method will need extra care that the correct values are validated and submitted. first method preferred
@mariekers mariekers added javascript Pull requests that update Javascript code material-ui react labels May 12, 2020
@mariekers mariekers added this to the Material UI components milestone May 12, 2020
@MikeyManoguerra
Copy link
Collaborator

This is mis-match between select value possibilities and store data that controls the component is happening in multiple places.

A more permanent solution is a component level loading state, so these select components are not render when either

  • data is being submitted
  • data is being retrieved from the api (program lists, insurers lists, etc)

@medy-io medy-io self-assigned this May 18, 2020
@mariekers
Copy link
Collaborator Author

@crsmyz do you still want to work on this?

@sxgormley
Copy link
Collaborator

@mariekers @crsmyz has there been any movement on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code material-ui react
Projects
None yet
Development

No branches or pull requests

4 participants