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

Support defaultOverscrollFactory() on iOS #1753

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

ASalavei
Copy link
Collaborator

@ASalavei ASalavei commented Dec 20, 2024

Add implementation of OverscrollFactory to support new Overscroll API.
Fix overscroll in CoreTextField and BasicTextField.
Upstreaming issue added: https://youtrack.jetbrains.com/issue/CMP-7307/Upstreaming.feature.foundation.text.rememberTextFieldOverscrollEffect

Fixes https://youtrack.jetbrains.com/issue/CMP-7143/Support-OverscrollFactory-and-LocalOverscrollFactory

Release Notes

Fixes - iOS

  • Enables Cupertino Overscroll by default for scrollable components
  • Experimental methodoptOutOfCupertinoOverscroll() removed.

@@ -313,6 +314,8 @@ internal fun BasicTextField(

DisposableEffect(textFieldSelectionState) { onDispose { textFieldSelectionState.dispose() } }

val overscrollEffect = rememberTextFieldOverscrollEffect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression after merging? Why should it be in the same PR? Why isn't it AOSP first edit?

Copy link
Collaborator Author

@ASalavei ASalavei Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a regression after merging?

Yes

Why should it be in the same PR?

It fixes bugs within the overscroll functionality. Basically, keeps the code that was added by us and removed then after AOSP merge. If you feel that it should be in another one, please let me know the reasons.

Why isn't it AOSP first edit?

  1. The feature has not beed upstreamed yet.
  2. Too long feedback loop.

@@ -148,8 +151,8 @@ class CupertinoOverscrollEffect(

private fun NestedScrollSource.toCupertinoScrollSource(): CupertinoScrollSource? =
when (this) {
NestedScrollSource.Drag -> CupertinoScrollSource.DRAG
NestedScrollSource.Fling -> CupertinoScrollSource.FLING

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it renamed? I might be slightly out of context here, could you please explain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the old values where deprecated and no longer supported.

@ASalavei ASalavei merged commit 7eabcc8 into jb-main Dec 20, 2024
6 of 7 checks passed
@ASalavei ASalavei deleted the andrei.salavei/support-overscroll branch December 20, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants