-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Material][Popover] Add support for virtual element as anchorEl #37465
Conversation
Netlify deploy previewBundle size report |
const selection = window.getSelection(); | ||
|
||
// Skip if selection has a length of 0 | ||
if (!selection || selection.anchorOffset === selection.focusOffset) { |
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.
Can you explain this conditional: selection.anchorOffset === selection.focusOffset
?
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.
Co-authored-by: Benny Joo <[email protected]> Signed-off-by: Diego Andai <[email protected]>
Co-authored-by: Benny Joo <[email protected]> Signed-off-by: Diego Andai <[email protected]>
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!
Changes
Add documentation, demo, and tests for using a virtual element (VE) as an anchor element for the
Popover
component.anchorEl
prop. Fixed previous definition: when providing a function for the anchor, the function doesn't receive any arguments.Popper
andTooltip
, as thePopover
expects the VE'snodeType
property to be1
(which is the type forNode.ELEMENT_NODE
).Screenshot of the new VE section on the docs
Closes #36416