-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add new Popover utility component #641
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
ca4de72
to
7205f2f
Compare
7205f2f
to
707aacc
Compare
@@ -3,5 +3,5 @@ | |||
* @returns true if CSS anchor positioning is supported, false otherwise | |||
*/ | |||
export function isCSSAnchorPositioningSupported() { |
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.
note: small scout to use a more standard approach to CSS feature detection. The original method used here was take from the polyfill's examples.
popovertarget: string | ||
popovertargetaction: 'hide' | 'show' | 'toggle' | ||
} | ||
|
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.
note: as the JS Doc highlights below, this is a (temporary) function that will help consumers avoid the use of @ts-expect-error
(or worse, @ts-ignore
) every time they wire up a trigger with a popover-based component.
}) | ||
|
||
useLayoutEffect(function polyfillCSSAnchorPositioning() { | ||
if (styleRef.current) { |
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.
note: applyCSSAnchorPositioningPolyfill
will conditionally apply the polyfill, so there's no need to check for support here.
Context
Menu
#636MenuItem
andAnchorMenuItem
components #637MenuGroup
component #640This PR
Popover
component. This will for the foundation of the new Menu component (and later, the Tooltip).