Repository navigation
fix(cdk/overlay): support SVG element as overlay origin - #18595
Conversation
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
@googlebot I fixed it. |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
crisbeto
left a comment
There was a problem hiding this comment.
We have some tests for using a point as an origin, so you should be able to copy and adjust those to cover an SVG element.
crisbeto
left a comment
There was a problem hiding this comment.
Good to go once the last comments are addressed.
|
Any chance for this fix to be included in v7 or v8? |
Workaround is to pass an |
Ah great, thanks for the tip! |
* Support SVG elements as overlay origin. * Review. * Cleanup. * Missing semicolon. * Review. * Remove describe. * Rename. Co-authored-by: Jeroen Zwartepoorte <jeroen.zwartepoorte@iddinkgroup.com> (cherry picked from commit 09f5476)
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently when you provide an
SVGElementwhen callingflexibleConnectedTo(...), it will not use the bounding client rect in the_getOriginRect()method, causing the overlay to appear at the top left of the viewport.This 1-liner fixes that by checking whether origin is an instance of
Elementinstead ofHTMLElement. No other changes are required.I looked at
flexible-connected-position-strategy.spec.ts, but i didn't see an obvious place to add a test (i did not see any tests checking if specifiying anHTMLElementorElementRefare supported either).