-
Notifications
You must be signed in to change notification settings - Fork 166
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
Implement ClickEvent.getRelativeY() #20488
Labels
Comments
Workaround: poll bounding client rect and calculate the relativeY value ourselves. The disadvantage is that this requires an additional request roundtrip to the server:
|
Could you please describe the case where it's needed? Is it a map or drawing component where you want to know the exact position within the component's area? |
mshabarov
moved this to Inbox (needs triage)
in Vaadin Flow enhancements backlog (Vaadin 10+)
Nov 19, 2024
mshabarov
moved this from Inbox (needs triage)
to Ready for Community
in Vaadin Flow enhancements backlog (Vaadin 10+)
Nov 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe your motivation
Vaadin 8 used to offer
MouseEvents.getRelativeY()
which would return the mouse position (y coordinate) when the click took place, relative to the clicked component.Unfortunately, there's no such function in Vaadin 23's
ClickEvent
- it offersscreenY
andclientY
but therelativeY
value can not be calculated from those values.Describe the solution you'd like
A
ClickEvent.getRelativeY()
function, mimicking Vaadin 8'sMouseEvents.getRelativeY()
. AlsoContextMenuEvent.getRelativeY()
function.The text was updated successfully, but these errors were encountered: