Open ticketapp opened 2 months ago
@ticketapp do you have a big single TextInput (multiline, but with disabled scroll) on the page?
Does it makes sense to use the KeyboardAwareScrollView
or maybe it would be better to use KeyboardAvoidingView
in this case? ๐ค
@kirillzyusko yes I have a big single TextInput (multiline with disabled scoll) on this page, but I have an other page with other elements of undetermined height where I need a KeyboardAwareScrollView
@ticketapp in your case the problem happens, because KeyboardAwareScrollView
detects text changes inside inputs and tries to assure, that input is located within visible area and is not obscured by header
or keyboard
:
Since you have a big input which is simultaneously obscured by keyboard and header - whenever you modify the text it will scroll down.
A straightforward approach would be to add a new property to KeyboardAwareScrollView
and allow to run this handler (onChangeText
) conditionally.
A more sophisticated approach would be to track cursor position (onSelectionChange
from useFocusedInputHandler
) and assure it's always in visible area but it would require more code changes๐
I think temporarily you can patch-package
this library and comment out onChangeText
handler - and in a meantime I'll try to invent a solution that will cover all the cases ๐
Thank you very much for your response
Many thanks @kirillzyusko ๐๐ฝ
Describe the bug When I delete an entire line of a long text it makes the scroll view scroll to the top. It happend on Android on 1.11.6 as well but has been fixed between 1.11.6 and the current version (1.12.6)
Code snippet
<KeyboardAwareScrollView> <Input.Area autoFocus scrollEnabled={false} value={editText} minHeight={55} onChangeText={setEditText} /> </KeyboardAwareScrollView>
Expected behavior The view shouldn't scroll if the line is not hidden
Screenshots https://github.com/user-attachments/assets/fcf71eba-a64b-46ac-bfc8-bb1db930b522
Smartphone (please complete the following information):