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 TextFieldScrollState and TextFieldScrollbarAdapter #384

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

m-sasha
Copy link
Member

@m-sasha m-sasha commented Jan 24, 2023

Proposed Changes

In order to support scrollbars for text fields, we need to expose their scroll state and implement a ScrollbarAdapter for it.

  • Implement TextFieldScrollState which wraps the actual (internal) text field scroll state object: TextFieldScrollerPosition, in order to allow hoisting.
  • Add BasicTextField overloads that accept the new TextFieldScrollState. Unfortunately this means copy-pasting them from the upstream source. We will need to remember to update them whenever the upstream changes.
  • Add a TextFieldScrollerPosition parameter to CoreTextField so that our new BasicTextFields can unwrap and pass the wrapper scroller position to it.
  • Add a viewportSize property to TextFieldScrollerPosition.

Testing

Test: Unit and manual tests

Issues Fixed

Fixes: JetBrains/compose-multiplatform#1575

@m-sasha m-sasha requested a review from igordmn January 24, 2023 22:07
@m-sasha
Copy link
Member Author

m-sasha commented Jan 25, 2023

@igordmn Ready for CR

@m-sasha m-sasha merged commit 125f049 into jb-main Jan 26, 2023
@m-sasha m-sasha deleted the feature/scrollbar-adapter-for-textfield branch January 26, 2023 20:48
igordmn pushed a commit that referenced this pull request Nov 15, 2023
igordmn pushed a commit that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EditText/BAsicEditText scroll support broken
3 participants