Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #32649
Closed
Open
Issue created Dec 29, 2020 by Patrick H. Lauke@patrickhlaukeContributor

Change default behaviour of carousels to make autoplay opt-in

After much head-scratching, I grokked that the carousel component currently:

  • autoplays by default after the first interaction (which seems rather pointless/nonsensical)
  • allows authors to make the autoplay start right on page load through the data-bs-ride="carousel" option
  • lets authors optionally pause the carousel autplay when hovering over it
  • lets authors suppress autoplay altogether (opt-out) by explicitly adding data-bs-interval="false"

I would argue that this component's behaviour is the exact opposite of what authors would expect (certainly coming from other frameworks, like AMP). The usual approach that, as an author, I'd expect is:

  • carousel is static by default
  • authors can explicitly opt into autoplaying at page load somehow (e.g. adding some sort of autoplay toggle, like data-bs-autoplay, defaulted to false, but authors can set it explicitly to true to opt-in)
  • for autoplaying carousels, stop the autoplay after an interaction (i.e. the user has explicitly clicked somewhere, moved focus into the carousel, is hovering over it) by default (this respects the user's intent by default)
  • allow authors to explicitly ignore users hovering over the carousel with the mouse (but don't do it for keyboard) - with added warning that the option should not be used for any kind of interactive slide content, as that will otherwise move the content from under the users' mouse pointer/feet. for this reason, don't offer this option for keyboard/focus, as there it would be even more annoying and potentially lead to focus being lost/reset to the start of the page. maybe call it data-bs-hoverstop, which defaults to true, but can be suppressed with false

admittedly this would now be a breaking change, but i think a change for the better.

Assignee
Assign to
Time tracking