Skip to content

Commit 1fc9d84

Browse files
[JEWEL-1188] Caret not moving when the popup is visible
1 parent 651a0c0 commit 1fc9d84

File tree

1 file changed

+11
-1
lines changed
  • platform/jewel/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/popup

1 file changed

+11
-1
lines changed

platform/jewel/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/popup/JDialogRenderer.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,17 @@ private fun JPopupImpl(
304304
is MouseEvent -> {
305305
if (shouldDismissPopup(event, dialog, currentProperties)) {
306306
currentOnDismissRequest?.invoke()
307-
event.consume()
307+
308+
// Only consume the event if it's NOT clicking on the owner component
309+
// This allows clicks on the owner component (editable combo box) to propagate
310+
// so the text field can receive them and move the caret
311+
val clickedOnOwner = component.bounds.contains(
312+
SwingUtilities.convertPoint(event.component, event.point, component)
313+
)
314+
315+
if (!clickedOnOwner) {
316+
event.consume()
317+
}
308318
}
309319
}
310320
is WindowEvent -> {

0 commit comments

Comments
 (0)