Add checks for menu position - #3290
Conversation
| val text = "I am a TextField" | ||
| val keyboardOptions = KeyboardOptions( | ||
| platformImeOptions = PlatformImeOptions { | ||
| usingNativeTextInput(false) |
There was a problem hiding this comment.
nit: it's default value, not needed
| Box( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .background(Color.White) |
There was a problem hiding this comment.
nit: can be omitted
| val horizontalDistance = menuFrame.horizontalDistanceTo(caretFrame) | ||
| val verticalDistance = menuFrame.verticalDistanceTo(caretFrame) | ||
| val contextMenu = if (newContextMenuEnabled) "new menu" else "old menu" | ||
| val maxDistance = 16.dp |
There was a problem hiding this comment.
nit: better to extract into constant
| BasicTextField2 | ||
| } | ||
|
|
||
| private class TextFieldLayoutInfo( |
There was a problem hiding this comment.
If it's possible to wait, then I suggest waiting for that PR to merge, I've made an API for that there
It would be also possible to use UIKitInstrumentedTest.setTextFieldContent (line 934)
instead of the UIKitInstrumentedTest.setOffsetTextFieldContent (line 297)
| verifyContextMenuItemsVisible(listOf("Paste")) | ||
|
|
||
| val pasteFrame = findNodeWithLabel("Paste").frame!! | ||
| val itemFrames = listOf("Select", "Select All").mapNotNull { label -> |
There was a problem hiding this comment.
If the purpose is to find a menu frame and assert that it is not far away from the caret, why not reuse finding_UIEditMenuContainerView (like it is done in waitForContextMenu()) instead of collecting and uniting frames of the items in this menu?
c18c734 to
d801335
Compare
Describe proposed changes and the issue being fixed
Fixes CMP-10602 Cover cases like CMP-10315 with iOS instrumented regression test for menu position
Failing case with BTF1 is Ignored until CMP-10315 is fixed.
Release Notes
N/A