Skip to content

Commit b258a4d

Browse files
authored
Fix wrong position of context menu in textfield on modal screens (#2020)
Partially fixes: https://youtrack.jetbrains.com/issue/CMP-7951/iOS-TextField-wrong-selection-carret-and-context-menu-behavior-with-TextField-inside-Dialog ## Testing Manual by using code from the task. This should be tested by QA ## Release Notes ### Fixes - iOS Fixed the behavior of a context menu in the textfields inside modally presented screens
1 parent 3f9bbdb commit b258a4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/IntermediateTextInputUIView.uikit.kt

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ internal class IntermediateTextInputUIView(
103103

104104
override fun canBecomeFirstResponder() = true
105105

106+
override fun resignFirstResponder(): Boolean {
107+
hideTextMenu()
108+
return super.resignFirstResponder()
109+
}
110+
106111
override fun beginFloatingCursorAtPoint(point: CValue<CGPoint>) {
107112
input?.beginFloatingCursor(point.useContents { DpOffset(x.dp, y.dp) })
108113
}

0 commit comments

Comments
 (0)