Skip to content

Conversation

@wellingtoncosta
Copy link
Collaborator

@wellingtoncosta wellingtoncosta commented Dec 16, 2025

Summary

Fixes an issue where clicking in an editable combo box text field while a popup is visible would dismiss the popup but fail to move the caret to the clicked position. Only happens with Custom Popup Renderer enabled.

The AWTEventListener was consuming all mouse press events that triggered popup dismissal, including clicks on the owner component (editable combo box). When the event was consumed, it never reached the text field component, preventing caret repositioning.

Solution

Removed the event.consume() in the MouseEvent branch and leave the consume to happen in the compose layer, as it's done for the WindowEvent logic.

Release notes

Bug fixes

  • Fixed caret not moving when clicking in an editable combo box text field while its popup is visible

Note

Fixes lost click handling when dismissing JDialog popups, ensuring clicks propagate to owner components for caret movement.

  • In JDialogRenderer.kt, remove event.consume() from the AWTEventListener MouseEvent path that triggers onDismissRequest
  • Keeps dismissal behavior intact for WindowEvent; compose layer now handles consumption

Written by Cursor Bugbot for commit f7875bd. This will update automatically on new commits. Configure here.

@wellingtoncosta wellingtoncosta self-assigned this Dec 16, 2025
@wellingtoncosta wellingtoncosta marked this pull request as draft December 16, 2025 18:45
@wellingtoncosta wellingtoncosta force-pushed the wp/editable-combo-box-bug branch from 1fc9d84 to 4656da7 Compare December 16, 2025 19:47
@wellingtoncosta wellingtoncosta marked this pull request as ready for review December 16, 2025 19:47
Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I noticed while I was testing the PR is that only skipping the event consumption is enough to fix the problems. The EditableComboBox has the logic to skip the onDismissRequest() call.

Maybe we can just remove the event.consume() and leave the consume to happen in the compose layer so it can handle cursor position changes/etc

@wellingtoncosta
Copy link
Collaborator Author

Something I noticed while I was testing the PR is that only skipping the event consumption is enough to fix the problems. The EditableComboBox has the logic to skip the onDismissRequest() call.

Maybe we can just remove the event.consume() and leave the consume to happen in the compose layer so it can handle cursor position changes/etc

You mean to just keep the currentOnDismissRequest?.invoke()? Haven't tested that, but I can check it out.

@wellingtoncosta wellingtoncosta force-pushed the wp/editable-combo-box-bug branch 2 times, most recently from c2d6ab6 to 3117302 Compare December 23, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants