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

Track Spotlight border-radius #562

Open
kfritsch opened this issue Dec 13, 2019 · 3 comments
Open

Track Spotlight border-radius #562

kfritsch opened this issue Dec 13, 2019 · 3 comments

Comments

@kfritsch
Copy link

Feature Idea

The handleMouseMove listener should respect the spotlight border-radius when deciding whether the mouse hovers the spotlight or not. When doing this it would probably be a good idea to give the spotlight per default the same border-radius as the highlighted container.

Motivation

If I am not mistaken this would follow the W3C Recommendation for Border Clipping.

the area outside the curve of the border edge does not accept pointer events on behalf of the element

Not tracking the border radius has unwanted side effect in certain scenarios because the spotlighted elements do behave according to this recommendation. Consider the case, where you want to spotlight a Modal with a significant border-radius. Clicks outside of the Modal close the Modal which shall be prevented by the overlay. Right now clicking inside the clipped area of the border radius triggers the closing of the modal thereby breaking the Joyride.

Implemetation Suggestion

Check if the mouse is in the spotlight rectangle (as is done right now). If so, check for each corner if the mouse is in the rectangle of the size of the respective border radius lengths. If so, check if the mouse is in the quarter ellipse of the border radius lengths with the origin being the inner corner of a corner rectanlge.

This pen contains example code.

@github-actions
Copy link

github-actions bot commented Mar 6, 2020

Stale issue message

@kfritsch
Copy link
Author

@gilbarbara ?

@gilbarbara
Copy link
Owner

hey @kfritsch
Sorry about the late reply!

I'll upgrade some dependencies in the next week and take a look at this.

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