metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.52k stars 605 forks source link

Disabled buttons allow click events on carousel cells behind it #798

Closed row1 closed 5 years ago

row1 commented 6 years ago

The fix for #716 has a side-effect where clicking on the disabled button allows the click event on the cell/item behind it to fire.

See: https://codepen.io/anon/pen/qyPbQM

Scenario 1: Click the disabled previous button and you will get the click event on the cell behind it. Not working as expected and breaks my current site. Scenario 2: Click the enabled next button and you will not get the click event on the cell behind it. Working as expected

desandro commented 6 years ago

Thanks for reporting this issue. Personally, I prefer being able to release dragging over a disabled button compared to capturing click events. I'll have to look into a solution that solves for both.

Korkman commented 6 years ago

My first / last cell is always clicked unintentionally when using prev / next buttons on touch devices. I have to add

.flickity-button:disabled { pointer-events: auto; }

Same happens with display: none for :disabled. May I suggest adding a small delay before setting :disabled?

desandro commented 5 years ago

I've decided not to pursue resolving this issue. This one has been quiet.

Mark-in-Motion commented 4 years ago

I'm also having this issue. Can the button not be disabled when you have arrived to the end of the gallery and just change the opacity of the button?