Open AviKKi opened 3 years ago
pointerenter and pointerleave is not supported in Safari/Safari IOS
@yhau1989 can you suggest a solution? If you want to solve this I can assign it to you.
in mobile the UX concept is touch (click) or slider automatic
I get what you are saying, it's how mobile YouTube app shows preview on scrolling, the video on top automatically starts preview.
But it won't work for my use-case, we are using 2 column grid. A expected behavior on mobile is when user touches(not click) over a thumbnail, it should start the preview.
A touch and a click are different, if you tap on the screen it's a click but if you touch and hold for a bit longer, it won't trigger click event; we want to trigger preview in this case.
As library grows we can add more configurations, but for now I'm focusing on this.
PS: My client has suggested that pornhub.com has this type of UX for thumbnail preview
@AviKKi haha pornhub.com is good case study, this events is activated when scroll is moving up or down, used id # by example
I'll dig into what event listeners they are using when I get the time. Your suggestion makes a lot sense.
I am work in a demo 🕙
my proposal is done , check out here in your📱
@yhau1989 this doesn't seem to be working
Edit - I had to resize my window for it to work.
I'm summing up your approach for future reference.
window.scrollY
, if found start it's preview.my remarks and opinion -
PS: This seems more like youtube app's logic, I'll reverse pornhub's code later(when I get some :alarm_clock: ) to see how they are doing it.
Of course, my change is focus in mobile version, but responsive design needs to be improved
mouseenter event is only registered on a tap, using pointerenter and pointerleave may help