The event handler registered to the container should not receive the click event.
If the pass was PointerEventPass.Initial, then the click event should be received. However, the default value for pass is PointerEventPass.Main. Since the TextField behaves as expected, it seems that the TextField does handle the mouse press event. However, it then fails to consume it and prevent it from propagating further up the tree.
Additional context
I have a mouse click handler on the TextField container in my app. When it receives a click, it uses focusRequester.requestFocus() on its own component. But when the click was actually in the TextField (inside the container), this unexpectedly messes with the focus in the TextField.
Describe the bug
Clicking a TextField should consume the press event (in the Main pass). But instead, it is not consumed and propagates to the parent element.
Affected platforms
Versions
Libraries:
Kotlin version:
OS version(s) (required for Desktop and iOS issues): Mac 14.5 (23F79)
OS architecture (x86 or arm64): arm64
JDK (for desktop issues): 20
To Reproduce Steps to reproduce the behavior:
Expected behavior
The event handler registered to the container should not receive the click event.
If the pass was
PointerEventPass.Initial
, then the click event should be received. However, the default value forpass
isPointerEventPass.Main
. Since the TextField behaves as expected, it seems that the TextField does handle the mouse press event. However, it then fails to consume it and prevent it from propagating further up the tree.Additional context
I have a mouse click handler on the TextField container in my app. When it receives a click, it uses
focusRequester.requestFocus()
on its own component. But when the click was actually in the TextField (inside the container), this unexpectedly messes with the focus in the TextField.