Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement iOS native feel scrolls for large text fields #771

Merged
merged 3 commits into from
Aug 28, 2023

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Aug 25, 2023

Proposed Changes

Construct and pass CupertinoOverscrollEffect inside Modifier.textFieldScrollable. Adapt non-null OverscrollEffect logic in text field to mimic behavior of LazyList to avoid text clipping through the container.

Testing

Test: TBD

Issues Fixed

Fixes: https://youtrack.jetbrains.com/issue/COMPOSE-336/iOS-native-scroll-physics-for-long-TextField

Note

TextFieldDecorationBox uses padding to layout internal text. textFieldScrollable is applied to entire container (with decoration box) and is not aware of it, so it can't do proper clipping when Modifier.offset is applied without a breaking internal API change.

Videos

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-08-25.at.11.40.12.mp4
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-08-25.at.11.53.09.mp4

@elijah-semyonov elijah-semyonov self-assigned this Aug 25, 2023
@elijah-semyonov elijah-semyonov changed the title Implement iOS native look and feel for text fields Implement iOS native feel scrolls for large text fields Aug 25, 2023
@dima-avdeev-jb
Copy link

Added Android implementation here: #775

@elijah-semyonov elijah-semyonov merged commit 2d317b6 into jb-main Aug 28, 2023
3 checks passed
@elijah-semyonov elijah-semyonov deleted the es/ios-textfield-scroll branch August 28, 2023 11:39
igordmn pushed a commit that referenced this pull request Nov 15, 2023
… fields (#771)

* Implement iOS native look and feel for text fields

* Remove dbg println

* Add Android actual rememberTextFieldOverscrollEffect (#775)

---------

Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com>
igordmn pushed a commit that referenced this pull request Nov 16, 2023
…l scrolls for large text fields (#771)

* Implement iOS native look and feel for text fields

* Remove dbg println

* Add Android actual rememberTextFieldOverscrollEffect (#775)

---------

Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants