[feat]: Add scrolling support to the Parallax component

Aperta
#2,190 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia individuando il componente Parallax e leggendo come la sua modalità orizzontale esistente gestisce lo scorrimento. Implementa il comportamento scorrevole proposto per l’input della rotellina del mouse senza interrompere l’animazione a molla, quindi verifica che le istanze orizzontali di Parallax possano navigare con la rotellina.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

template: request
A clear and concise description of what the feature is

In regards to the Parallax component, currently there is a prop to handle scroll direction, either vertical or horizontal. When horizontal is set to true, mouse wheel functionality is disabled, and users with mice are unable to use the scroll wheel to navigate through the page.

I propose the addition of a prop scrollable that would be a compliment to horizontal where when set to true, users could use the mouse wheel to scroll through the page.

Why should this feature be included?

As it stands, if you need horizontal scrolling as well as the ability to use a mouse wheel to do it, you need to rely on external options which add code to your project, don't play well with React Spring, and perform poorly.

Please provide an example for how this would work
<Parallax
  horizontal={true}
  scrollable={true}
>
  //content
</Parallax>

// the property scrollable would engage an event listener similar to the following:
// ref.current.container.current.scrollLeft += event.deltaY + event.deltaX
// the above solution works, but is janky and doesn't compliment the spring animation implemented by <Parallax>
Lingua principale
TypeScript
Stelle
29.3k
Fork
1.2k
Merge medio
3g 15h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pmndrs/react-spring

Tutte le issue di pmndrs/react-spring

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.