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

Elements behind the OutClick element are interactable on a mobile/tablet device when trying to close the overlay #7

Closed
babakfp opened this issue Jul 9, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@babakfp
Copy link
Owner

babakfp commented Jul 9, 2022

Link to REPL

Go to responsive mode from dev tools and select a mobile device. Try to toggle the box when the box is visible (when you are seeing the dark overlay). You will see that it's impossible to close the box.

Video_22-07-09_16-26-13.mp4

The component uses pointerdown instead of click to simulate an outclick event because of #4 and #6. If you try to solve this issue, please pay attention to those 2 issues too.

See the source code for the OutClick component

@babakfp babakfp added the help wanted Extra attention is needed label Jul 9, 2022
@babakfp
Copy link
Owner Author

babakfp commented Oct 18, 2022

it looks like this issue is fixed somehow! I Didn't change or do anything. So, I'm closing it :)

@babakfp babakfp closed this as completed Oct 18, 2022
@babakfp babakfp reopened this Jan 14, 2024
@babakfp
Copy link
Owner Author

babakfp commented Jan 14, 2024

This isn't fixed and it happens only on touch devices.

@babakfp
Copy link
Owner Author

babakfp commented Jan 14, 2024

@iSteeb

Hey 👋

Could you please check this reproduction and let me know if it works based on what you reported in #6?

https://svelte.dev/repl/2430ffff1c164588932654be467cfaab?version=4.2.8

I've changed (pointerdown and pointerup) to (touchstart and touchend) and (mousedown and mouseup). When a touch event is triggered, we use touch events, otherwise we use mouse events. Meaning on touch devices (mobile/tablet), touch events will be used and on desktop (when touch is not available), mouse events will be used.

@babakfp
Copy link
Owner Author

babakfp commented Jan 14, 2024

It seems like there is a problem with this approach:

Rec.0026.mp4

We don't want to trigger an outclick when the touch started outside and ended inside.

@babakfp babakfp closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant