feat(cdk/overlay): HTML id attributes in overlay elements
See original GitHub issueFeature Description
CDK Overlay component creates a set of div-Elements
into the DOM. It would be much easier to write custom Positioning-Strategies
or Scroll-Strategies
if the div-Elements
had HTML id attributes.
Use Case
I was trying to write a custom Scroll-Strategy
for an overlay. My idea was to change some css properties on the overlay-div-Elements
to customize scrolling behaviour. Its very difficult to find the overlay div-Elements in the DOM without having an id attribute. I had to search the elements by css-class-names.
If css-style manipulation is not the recommended way to write custom Scroll-Strategies, please close the issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Overlay
The overlay package provides a way to open floating panels on the screen. link Initial setup. The CDK overlays depend on a small...
Read more >Custom Overlays with Angular's CDK
In this post, we'll use the CDK to build a custom overlay that looks and ... <div class="cdk-overlay-container"> <div id="cdk-overlay-0" ...
Read more >Angular CDK : attach overlay to a clicked element
I suppose I need to do the following : Get the ElementRef of the 'td' where I click -> I don't know how;...
Read more >Untitled
Luke chapter 7 quiz, Atestate informatica html, Bharat guthan details. ... Photography snow overlay, Waar houden hommels niet van, Body sculpture bike ...
Read more >Untitled
Can display images, HTML elements, SWF movies, Iframes and also Ajax ... learn how to use the Angular CDK overlay feature to create...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah ok, I see. The
OverlayReference
is an interface that is meant to mimic theOverlayRef
. It’s used primarily by us to avoid circular imports. I’ll submit a PR to update it with all the public properties, but until then, you should be able to cast theoverlayRef as OverlayRef
. Here’s what the full class looks like: https://github.com/angular/components/blob/master/src/cdk/overlay/overlay-ref.tsThe current
OverlayRef
gets passed to the scroll strategy in theattach
method. From there you can read theoverlayElement
property to get the current overlay that the strategy is attached to.