question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat(cdk/overlay): HTML id attributes in overlay elements

See original GitHub issue

Feature 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Jul 27, 2021

Ah ok, I see. The OverlayReference is an interface that is meant to mimic the OverlayRef. 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 the overlayRef as OverlayRef. Here’s what the full class looks like: https://github.com/angular/components/blob/master/src/cdk/overlay/overlay-ref.ts

1reaction
crisbetocommented, Jul 23, 2021

The current OverlayRef gets passed to the scroll strategy in the attach method. From there you can read the overlayElement property to get the current overlay that the strategy is attached to.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found