Skip to content
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

Expose overlay pointer events as public API so user can prevent backdrop from consuming clicks #14062

Closed
benelliott opened this issue Nov 9, 2018 · 5 comments
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@benelliott
Copy link
Contributor

Bug, feature request, or proposal:

Proposal

What is the expected behavior?

It would be great if the user could choose to disable pointer events on an overlay backdrop so that elements underneath the overlay can still be interacted with. In my use case, I am using an overlay to create a custom read-only tooltip-like readout, so the content of the overlay itself is not interactive, but the content underneath the backdrop is.

What is the current behavior?

I am currently disabling pointer events by using a private API:

(overlay.overlayRef as any)._togglePointerEvents(false);

Is there anything else we should know?

Somewhat related to #9320

@vivian-hu-zz vivian-hu-zz added feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Nov 9, 2018
@crisbeto
Copy link
Member

crisbeto commented Nov 9, 2018

The OverlayRef already exposes the overlayElement and backdropElement. You should be able to use them to style the elements. Also FWIW, disabling pointer events on the backdrop would basically be the same as removing the backdrop altogether.

@crisbeto crisbeto closed this as completed Nov 9, 2018
@benelliott
Copy link
Contributor Author

@crisbeto Sorry - when I wrote this I forgot what I was actually trying to do. I want to disable pointer events on an overlay without a backdrop.

Like you said, I could achieve this by doing overlay.overlayRef.overlayElement.style.pointerEvents = 'none' but it seems a bit dirty considering there is already the _togglePointerEvents method on the OverlayRef?

@crisbeto
Copy link
Member

That method is mostly there for convenience. I don't think your example is dirty, because we exposed the overlayElement to handle cases like this one.

@benelliott
Copy link
Contributor Author

Cool, thanks.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

3 participants