Feature request: opt-in native keyboard avoidance
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- mobile-dev
Direzione di ricerca
The work already exists as PR #135, so read that diff first; it adds a per-platform file for the keyboard tracking plus prop plumbing through the sheet component. Compare against the existing content detent and windowOverlay code paths the issue describes. Done means keyboardAvoidance and keyboardOffset are passed through, the sheet animates with the keyboard on iOS and frame-by-frame on Android, and nothing changes on web.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, and thanks for the library!
I know keyboard handling is left to the app (#9, #66). That works well for a list inside a fixed-height sheet. It doesn't work well for a short sheet that should sit on top of the keyboard, like a small form. The sheet's position is controlled natively, so app code can only react to the keyboard after the fact:
- Changing the detent from Keyboard events works, but the sheet moves with its own spring, not with the keyboard. On Android it only starts moving after the keyboard has finished opening.
- react-native-keyboard-controller's layout mode changes the content height every frame, but the 'content' detent only picks up the final height. So the sheet jumps when opening and lags behind when closing.
- React Native's automaticallyAdjustKeyboardInsets measures before the sheet moves, so the content ends up scrolled too far.
I built a small opt-in version inside the sheet to see if it works, and it does:
- keyboardAvoidance (off by default): while an input inside the sheet is focused, the sheet moves up in the same animation as the keyboard. On iOS that's the keyboard's own animation; on Android it follows the keyboard frame by frame. Drag, snapping, detents and the scrim are not affected.
- A tall sheet that can't move up any further gets extra bottom space in its scroll view, and the focused input is scrolled above the keyboard. Moving to the next input scrolls smoothly too.
- keyboardOffset: an optional extra gap between the sheet and the keyboard. A negative value hides the sheet's bottom padding behind the keyboard.
It's tested on the iOS simulator and the Android emulator, including windowOverlay. It's one new file per platform plus passing the props through, and it does nothing on web.
Would you be open to a PR for this? I'm happy to change the API to whatever you prefer.
Update: I opened a PR with the implementation and recordings: #135
- Lingua principale
- Kotlin
- Stelle
- 536
- Fork
- 24
- Merge medio
- 12h 10m
- PR unite (30g)
- 22
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di software-mansion/react-native-bottom-sheet
-
Android: NoSuchElementException in ScrollIndicators.refit when a scroll view is garbage collectedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
software-mansion/react-native-bottom-sheet#140 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
software-mansion/react-native-bottom-sheet#137 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
software-mansion/react-native-bottom-sheet#132 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
software-mansion/react-native-bottom-sheet#74 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
software-mansion/react-native-bottom-sheet#64 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di software-mansion/react-native-bottom-sheet
Issue simili
-
Remove Collect againAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
thisisartman/Meguri#211 ·
I maintainer di solito rispondono entro 1 giorno
-
follow-up
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
area:android fleet
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
emm3000/myGame#2175 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno