CYPIAPT-LNDSE / welcome-to-camhs

Fun and accessible questionnaire for children when first visiting CAMHS.
https://welcome-in.herokuapp.com/
MIT License
5 stars 3 forks source link

Click/Touch is not working on carousel item #181

Closed skibinska closed 7 years ago

skibinska commented 7 years ago

I want to be able to click on avatar (a carousel item) and add information to session storage and go to the next page. Unfortunately click/touch doesn't work on our deployed version on heroku on mobile/tablet, but it works on desktop. It works on my local version (mobile, tablet, desktop). I am using materialize-css.

Any suggestions?

skibinska commented 7 years ago

I found this issue https://github.com/Dogfalo/materialize/issues/4586 and I checked the version of materialize in our project. Our tap function doesn't have e.preventDefault();, so this is not solution in our case.

skibinska commented 7 years ago

I tested it on a Samsung Galaxy tab and it doesn't work.

des-des commented 7 years ago

@skibinska Hi

So I am going to try and give you some general advice, not sure I have any experience with your particular problem.

When I reach the point of total stuckness and dejection with a bug, I take a step back.

Make a new repo, and try and create a minimal example of your bug.

If you cannot replicate you bug, then you are probable missing the problem. In that case, go back to your project, checkout to a new branch, and delete functionality with abandon. At some point your bug might disappear, which might point you at a problem.

This might seem like a slow approach, but sometimes it has worked for me as a last resort.

skibinska commented 7 years ago

hey @des-des , thanks for your advice! It was very helpful :)

I created a new repo and I replicated the bug. I found out that the bug is not in our code - it is in materialize-css. If you have a look at the materialize-css website, their example of carousel doesn't work on mobile (it doesn't detect click/touch event).

My approach to solve this problem: