Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button clicked event is raised even with mouse button pressed on another view. #3392

Closed
BDisp opened this issue Apr 9, 2024 · 3 comments
Closed

Comments

@BDisp
Copy link
Collaborator

BDisp commented Apr 9, 2024

Describe the bug
The clicked event should only occur if the view mouse button was pressed and released on the same view, not at same same coordinates as it happened previously. The terminal mouse API should raise the clicked event but is View responsibility to send it to the valid view. The terminal mouse API don't know about the View class and only send the clicked event because a Pressed+Release mouse button occurred.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'UICatalog.'
  2. Open the 'Buttons' scenario
  3. Check if the first 'TextField' is selected and press the mouse on it
  4. Kept the mouse pressed and move the mouse to any of the buttons and release the mouse
  5. The Dialog is opened even the mouse button pressed and released wasn't in that view
  6. This doesn't happens if you press the mouse on a Button and release it on another Button, which is good

Expected behavior
The clicked event should not occurred.

@BDisp
Copy link
Collaborator Author

BDisp commented Apr 9, 2024

This code isn't totally correct. The _mouseEnteredView which in my opinion is the latest that ran the OnMouseEnter event isn't updated if the return is called before any chance of it being setting in the case of the current view is different.

image

The line _mouseEnteredView?.NewMouseLeaveEvent (mouseEvent); may contain an outdated view.

@BDisp
Copy link
Collaborator Author

BDisp commented Apr 9, 2024

Another issue is when the mouse button is pressed on a Button and kept pressed move to another Button and release the mouse. The clicked event isn't executed and this is good, but if you press and release the mouse in the second button nothing happen. Only on the second mouse press and release the clicked event is processed.

@tig
Copy link
Collaborator

tig commented Apr 9, 2024

Describe the bug The clicked event should only occur if the view mouse button was pressed and released on the same view, not at same same coordinates as it happened previously. The terminal mouse API should raise the clicked event but is View responsibility to send it to the valid view. The terminal mouse API don't know about the View class and only send the clicked event because a Pressed+Release mouse button occurred.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'UICatalog.'
  2. Open the 'Buttons' scenario
  3. Check if the first 'TextField' is selected and press the mouse on it
  4. Kept the mouse pressed and move the mouse to any of the buttons and release the mouse
  5. The Dialog is opened even the mouse button pressed and released wasn't in that view
  6. This doesn't happens if you press the mouse on a Button and release it on another Button, which is good

Expected behavior The clicked event should not occurred.

The cause is:

Another way to reproduce it:

  1. Run UI Catalog
  2. Ctrl-A to open about box
  3. Press and hold mouse outside of about box
  4. Drag over about box

Expected:

  • Nothing happens

Actual:

  • About box moves

XDOIDNj 1

Closing as duplicate.

@tig tig closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants