question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VOTE: Opinion wanted before release of v.3!

See original GitHub issue

Question: Should Embla Carousel be responsible for toggling classnames out of the box or should this be up to the user to implement?

WIth Embla v.3 this is easily achieved like so:

const embla = EmblaCarousel(emblaNode, { loop:false })

const selectedClass = 'is-selected'
const draggableClass = 'is-draggable'
const draggingClass = 'is-dragging'

function applyDraggableClasses() {
  emblaNode.classList.add(draggableClass)
  embla.on('pointerDown', () => emblaNode.classList.add(draggingClass))
  embla.on('pointerUp', () => emblaNode.classList.remove(draggingClass))
}

function applySelectedClasses() {
  const slidesInView = embla.slidesInView(true)
  const slidesNotInView = embla.slidesNotInView(true)
  slidesNotInView.forEach(i => slides[i].classList.remove(selectedClass))
  slidesInView.forEach(i => slides[i].classList.add(selectedClass))
}

applyDraggableClasses()
embla.on('select', applySelectedClasses)
embla.on('pointerUp', applySelectedClasses)
embla.on('init', applySelectedClasses)

Basically, this suggestion is about deprecating the following options:

Voting closed! Embla v.3 will still support all these options.

👍 = Keep these options

👎 = Remove these options

I’m going to throw out random pings to get this started. I hope you don’t mind.

@gunnarx2, @xiel, @olushchik, @nikrowell, @yocmen, @LaksCastro, @bitttttten, @mrksmts, @jakubreron, @iamkevingreen, @niubsta, @michaelrambeau, @omarkhatibco, @readeral, @allen-garvey, @ontrigger.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
davidjerlekecommented, Jun 11, 2020

Thank you all for voting! Embla will still support the class name toggling in v.3 with one addition: The possibility to opt-out by passing empty strings as classnames for all these options.

Stay tuned for Embla Carousel version 3!

Hit the watch button to get notified about the release 📣.

3reactions
omarkhatibcocommented, Jun 9, 2020

@davidcetinkaya I would like to keep the classNames since I using it every time to style my slider.

I know I can easily implement it but it’s overhead to do the same code every time you need to use the slider.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About Section 5 Of The Voting Rights Act - Department of Justice
The Shelby County decision. On June 25, 2013, the United States Supreme Court held that it is unconstitutional to use the coverage formula...
Read more >
Know Your Rights | Voting Rights
What are my general rights on Election Day? The poll worker says my name is not on the list of registered voters; I...
Read more >
Voting Rights Act (1965) | National Archives
EnlargeDownload Link Citation: An act to enforce the fifteenth amendment to the Constitution of the United States and for other purposes, ...
Read more >
Rock the Vote - Register to Vote, Find Election Info, and More!
Dedicated to building the political power of young people. Register to vote, check your registration status, and more. Fast, easy, secure, nonpartisan.
Read more >
Election Security Rumor vs. Reality - CISA
When a ballot cannot be read by a scanner at a voting site, election officials apply procedures to securely store the ballots until...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found