-
Notifications
You must be signed in to change notification settings - Fork 319
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
feat(clerk-js,types): Add modalsCloseOnClickOutside
option
#5139
base: main
Are you sure you want to change the base?
feat(clerk-js,types): Add modalsCloseOnClickOutside
option
#5139
Conversation
🦋 Changeset detectedLatest commit: 7155cb4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
!snapshot |
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
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.
Requested changes to avoid breaking captcha if merged. Other than that, it looks good
const { disableScroll, enableScroll } = useScrollLock(document.body); | ||
const overlayRef = useRef<HTMLDivElement>(null); | ||
const { floating, isOpen, context, nodeId, toggle } = usePopover({ | ||
defaultOpen: true, | ||
autoUpdate: false, | ||
outsidePress: e => e.target === overlayRef.current, | ||
outsidePress: outsidePress === true ? e => e.target === overlayRef.current : false, |
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.
is this different from the canCloseModal
property?
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.
canCloseModal
prevents closing the modal entirely, close icon is removed to. canCloseModal
is used within the useDismiss
hook. This is also an internal only prop.
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.
Thank you for explaining. Initially, I thought it would be a little confusing having both of these properties at the same time.
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.
Yeah, no problem, I can see how the naming can be confusing. Still noodling on names, let me know if you have opinions #5139 (comment)
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.
I've also went ahead and added comments to clarify the different functionality 7155cb4
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.
Let's iterate a bit on the naming, if possible.
@clerk/sdk-infra any ideas on naming preferences for this functionality? My other thought is |
@alexcarpenter WDYT about |
assuming @panteliselef would have the same issues with that as I think the length was the problem if I remember correctly. |
Let's not delay this further, I cannot come up with a shorter name unfortunately. |
Description
Introduce new option
modalsCloseOnClickOutside
to disable closing modals when users click outside of the modal element on the modal overlay.Screen.Recording.2025-02-12.at.3.45.10.PM.mov
Resolves SDKI-810
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change