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

fix: Auto-close country codes dropdown when clicking outside the component #7561

Conversation

UdaySagar-Git
Copy link
Contributor

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@UdaySagar-Git UdaySagar-Git requested a review from a team as a code owner April 7, 2024 06:34
Copy link

vercel bot commented Apr 7, 2024

@UdaySagar-Git is attempting to deploy a commit to the Open Healthcare Network Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

netlify bot commented Apr 7, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 065c869
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6627bbd103fa980008097205
😎 Deploy Preview https://deploy-preview-7561--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

nihal467 commented Apr 8, 2024

LGTM

Copy link
Member

@khavinshankar khavinshankar left a comment

Choose a reason for hiding this comment

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

just a small refactor required

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Would it be possible to use one of the headlessui component to handle the dropdown/popover? So that we won't need a custom hook to handle click outside to begin with?

@UdaySagar-Git
Copy link
Contributor Author

Would it be possible to use one of the headlessui component to handle the dropdown/popover? So that we won't need a custom hook to handle click outside to begin with?

will give it a try

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

You can use the close method provided by headlessui to avoid hacks and using an additional useState.

image

https://headlessui.com/react/popover#closing-popovers-manually

src/Components/Form/FormFields/PhoneNumberFormField.tsx Outdated Show resolved Hide resolved
src/Components/Form/FormFields/PhoneNumberFormField.tsx Outdated Show resolved Hide resolved
src/Components/Form/FormFields/PhoneNumberFormField.tsx Outdated Show resolved Hide resolved
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 55ec1e3 into coronasafe:develop Apr 24, 2024
27 of 29 checks passed
Copy link

@UdaySagar-Git 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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-close country codes dropdown when clicking outside the component
5 participants