dynamicweb / swiffy-slider

Super fast carousel and slider with touch for optimized websites running in modern browsers.
MIT License
238 stars 29 forks source link

indicators on mobile device fail on Lighthouse check #87

Closed MarvinXu closed 6 months ago

MarvinXu commented 6 months ago

Describe the bug Sometimes I want to show indicators in mobile device to indicate this is a slide, and in this case indicators don't act as buttons as they are too small to tap. But it's still have a button tag so lighthouse complains "Tap targets are not sized appropriately".

To Reproduce Steps to reproduce the behavior:

  1. add .slider-indicators-sm class on the wrapper
  2. open devtool -> lighthouse to generate a report on mobile device

Expected behavior What can we do to bypass this rule?

nicped commented 6 months ago

Hi You do not have to use buttons - you can use a ul>li list instead like it does on the configuration site: https://swiffyslider.com/configuration/?slider-indicators-dark=slider-indicators-dark&slider-indicators-outside=slider-indicators-outside&slider-indicators-sm=slider-indicators-sm

Alternatively you can style the indicators to have a size that is big enough for mobile lighthouse.

Last option I can think of, is to use scrollbar as indicator instead: https://swiffyslider.com/configuration/?slider-nav-scrollbar=slider-nav-scrollbar

My personal favorite is using the scrollbar

MarvinXu commented 6 months ago

Thank you for detailed reply! I totally forgot button tags were written by myself 😂

Changing to li works for lighthouse.

I also checked scrollbar, but it doesn't show on mobile device

nicped commented 6 months ago

Cool. True - scrollbar is only visible when Scrolling (iOS at least), so if there are no navigation arrows, the user have a hard time figuring out that it is a slider.