[Bug] "Add Cluster" popup closes when text selection drag ends outside the dialog
Describe the bug
The "Add Cluster" popup closes unintentionally when a mouse drag that started inside the dialog ends outside of it.
When selecting text in an input field (mouse button pressed inside the field) and the cursor is moved beyond the edge of the popup before releasing the button, the popup closes.
This is most likely caused by the backdrop/overlay closing the dialog on click/mouseup, even though the interaction (mousedown) started inside the dialog.
Steps to Reproduce
- Open the "Add Cluster" popup
- Click into a text input field, enter some text, then press and hold the left mouse button inside the field to start selecting text
- While holding the button, drag the cursor outside of the popup (onto the dimmed background) and release the button there
- The popup closes, and the entered data is lost
Expected behavior
The popup should only close when both mousedown and mouseup happen on the backdrop (i.e. a real click outside the dialog). A drag that starts inside the dialog and ends outside must not close it, so that text selection doesn't result in lost input.
Environment
- PegaProx Version: 1.4.1
- Installation Method: Option 1: Automated Installation
- OS: Debian 13
- Browser: Chrome 131
- Behind Reverse Proxy? No
- UI? Corporate and Modern Layout
Logs
not applicable
Screenshots
not applicable
Checklist
- [x] I have searched existing issues to make sure this is not a duplicate
- [x] I am using the latest version of PegaProx
- [x] I've put enough in here that someone can start on it without asking me three questions first
- [x] I understand PegaProx is maintained by volunteers in their free time. Nobody is on call, and writing URGENT doesn't get anyone out of bed 🪄
Confirmed, thanks for the clear steps. The Add Cluster backdrop closes the dialog on click, and a drag that starts in an input and ends on the dimmed background fires that click on the backdrop, so the form is thrown away. Other dialogs in the UI already close only when the press starts on the backdrop itself, so it's a small change; noted.
Jan-Philipp
Thanks for the precise description, you had the cause right. When a drag starts in a field and ends on the dimmed backdrop, the browser sends the click to the backdrop, and the backdrop closed the dialog on that click.
Fixed on our development branch (Testing) for every dialog, not only Add Cluster: a click that comes out of a drag that started in a field (or selected text) is dropped now, so selecting text and letting go outside keeps the dialog and what you typed. A real click on the backdrop still closes it. This ships with the next release.
Fixed in 1.5.0, the Add Cluster dialog stays open when a text selection ends outside of it. Closing, thanks!