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

Fix content rect calculation in SelectionManager #1270

Merged
merged 1 commit into from Apr 19, 2024

Conversation

mazunin-v-jb
Copy link

@mazunin-v-jb mazunin-v-jb commented Apr 15, 2024

Proposed Changes

Cherry-picked from androidx

Fix a typo in SelectionManager.getContentRect() that results in an invalid rect being calculated, causing text toolbar to not show under certain conditions.

Fixes: b/332782845
Test: manual
Change-Id: I153b99f4146d870182af2898d9a675ed6ffa15e4

Testing

Test: Open test app, go Components -> Selection, try to select text in selection container

Issues Fixed

Fixes: appearing of editing menu in selection container in wrong position
https://youtrack.jetbrains.com/issue/COMPOSE-1190/iOS-Selection-Container-cant-show-options-menu
JetBrains/compose-multiplatform#4322
b/332782845 in Google

Google CLA

You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.

Fix a typo in `SelectionManager.getContentRect()` that results in
an invalid rect being calculated, causing text toolbar to not show
under certain conditions.

Fixes: b/332782845
Test: manual
Change-Id: I153b99f4146d870182af2898d9a675ed6ffa15e4
@mazunin-v-jb mazunin-v-jb requested review from MatkovIvan and removed request for elijah-semyonov April 18, 2024 15:38
@MatkovIvan MatkovIvan merged commit cd47b70 into jb-main Apr 19, 2024
6 checks passed
@MatkovIvan MatkovIvan deleted the v.mazunin/cherry-pick-fix-edit-menu-position branch April 19, 2024 07:58
@MatkovIvan MatkovIvan restored the v.mazunin/cherry-pick-fix-edit-menu-position branch April 19, 2024 07:59
@MatkovIvan MatkovIvan deleted the v.mazunin/cherry-pick-fix-edit-menu-position branch April 19, 2024 07:59
MatkovIvan pushed a commit that referenced this pull request Apr 19, 2024
…1269)

## Proposed Changes

- Added creating a text interaction view (which is required to show the
edit menu by long press / double tap on the text) in case when there is
no one (i.e. only selection container presents of the screen without any
other text editing views)
- Fixed its position on the screen (changes from androidx:
#1270)

## Testing

Test: Open test app, go Components -> Selection, try to select text in
selection container

## Issues Fixed

Fixes: 
-
https://youtrack.jetbrains.com/issue/COMPOSE-1190/iOS-Selection-Container-cant-show-options-menu
- JetBrains/compose-multiplatform#4322

## Google CLA
You need to sign the Google Contributor’s License Agreement at
https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP
repository. Signing this agreement allows us to synchronise code from
your Pull Requests as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants