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 text input popup position #339

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Fix text input popup position #339

merged 2 commits into from
Dec 5, 2022

Commits on Dec 1, 2022

  1. PlatformTextInputService. Undeprecate notifyFocusedRect

    Fixes JetBrains/compose-multiplatform#2040
    Fixes JetBrains/compose-multiplatform#2493
    
    notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647
    
    On Android, before deprecation this method was used to scroll to the focused text input.
    This functionality was extracted to the text field itself, but we had another functionality on the other platforms.
    On Desktop we show text input popup near text input (for some languages):
    JetBrains/compose-multiplatform#2040 (comment)
    
    I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives:
    
    1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position
    2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area.
    igordmn committed Dec 1, 2022
    Configuration menu
    Copy the full SHA
    986c8fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c532142 View commit details
    Browse the repository at this point in the history