-
Notifications
You must be signed in to change notification settings - Fork 489
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
Handle no option available case when local body returns empty response #7359
Handle no option available case when local body returns empty response #7359
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be better if we moved this logic to the Select Menu component itself so it'd be applicable in all use cases?
That is a holistic approach. Let me update the PR accordingly! |
@mohanrajnambe is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
Since the logic of either disabling or the placeholder text 'No options available' relies on the length of the option, taking that into selectmenu component is not viable unless we bring in a new prop to configure that again. So, 'options.length' is a good to have in the component which is utilising the SelectFormField(SelectMenuV2) LMK your thoughts |
But |
I understand that we are trying to handle it in the root. Validating the options.length for placeholder text will lead to display 'No options available' instead of 'Choose of an option' at the first render. Here we bring data based on some other action. (for eg. based on what city is selected) If we rely on options.length in the selectMenu itself, we loose the 'choose an option' placeholder initially and tend to display the 'no option available'. This is not the right way. Either we should handle it at where we use the component We can disable the selectmenu based on option.length but the user will not know why it is disabled. |
For the placeholder, simply show "Choose an option" if |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
👋 Hi, @mohanrajnambe, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@rithviknishad Any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
@mohanrajnambe Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist