Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Embla Carousel - select inner text

I have a carousel built using Embla Carousel (embla-carousel-react).

The elements within the carousel contain an image and some text. The text is not selectable, but I would like it to be.

When I set draggable: false, I can select the text inside the carousel, but now I can no longer scroll the carousel to the next slide.

Is there a way I can have both - select and copy text with a mouse click and drag, and swipe to the next scroll with a more pronounced swipe or scroll gesture?

const EmblaCarousel = ({ children, nextScroll, recordCurrentSlide }) => {
  const { height } = useWindowDimensions()

  const [viewportRef, embla] = useEmblaCarousel({
    axis: "y",
    skipSnaps: false,
    startIndex: 0,
    draggable: true,
    dragFree: false,
    slidesToScroll: 1,
    loop: true,
  }, 
  [WheelGesturesPlugin()]);


  return (
    <div className="embla">
      <div className="embla__viewport" ref={viewportRef}>
        <div className="embla__container">
          {children}
        </div>
      </div>
      <style jsx>{`
      :global(.embla__container) {
        height: ${height};
      }
    `}</style>
    </div>
  );
};

Thanks!

almost 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda