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

Do not dispatch display events for elements hidden with styles #16

Open
michael-parkins opened this issue Oct 19, 2021 · 0 comments
Open

Comments

@michael-parkins
Copy link
Collaborator

michael-parkins commented Oct 19, 2021

🚀 Feature request

Please describe what is needed
Currently the oculrDisplay directive will dispatch display events as long as Angular builds the element in the DOM. Elements that do not render visually on the screen due to styles are still in the DOM and will still dispatch a display event even though the user didn't see the element.

Describe the solution you'd like

  • Check if element is visible based on styles. There are many way to hide an element, we should limit this check to the following commonly used solutions:
    • display: none
    • opactity: 0
    • visibility: hidden
  • Bind to style changes to determine if element is going from hidden to visible state

Describe alternatives you've considered
The lib currently allows a manual display dispatch using services. This isn't optimal, but still works. Since there are many ways to hide elements, its possible an incomplete enhancement will make the API more cumbersome with little gain.

@mikejancar mikejancar added this to the site analytics milestone Nov 4, 2021
@michael-parkins michael-parkins removed this from the site analytics milestone Jan 19, 2022
@mikejancar mikejancar assigned mikejancar and unassigned mikejancar Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants