Skip to content

feat: Adds relevant API to allow drag and drop to a certain location#23187

Merged
caalador merged 9 commits into
mainfrom
feature/dd-client-xy
May 6, 2026
Merged

feat: Adds relevant API to allow drag and drop to a certain location#23187
caalador merged 9 commits into
mainfrom
feature/dd-client-xy

Conversation

@mstahv
Copy link
Copy Markdown
Member

@mstahv mstahv commented Jan 12, 2026

Exposes clientX/Y for all D&D events, to allow "repositioning" absolutely positioned drag and drop component. Also exposing offsets of the target and start element (if operation started on top of Vaadin component), so that one can build UIs where "things" are dragged on a specific location of another component.

Fixes #19297

Type of change

  • Bugfix
  • Feature

Test case derived from a community feedback/question
…ation

Added offset coordinates related to start and drop of the operation.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 12, 2026

Test Results

 1 399 files  +2   1 399 suites  +2   1h 13m 59s ⏱️ -41s
10 103 tests +8  10 033 ✅ +8  70 💤 ±0  0 ❌ ±0 
10 578 runs  +8  10 499 ✅ +8  79 💤 ±0  0 ❌ ±0 

Results for commit f4b1f3e. ± Comparison against base commit 81e9281.

♻️ This comment has been updated with latest results.

@mstahv mstahv marked this pull request as ready for review January 12, 2026 20:15
@mcollovati mcollovati changed the title Adds relevant API to allow drag and drop to a certain location feat: Adds relevant API to allow drag and drop to a certain location Jan 12, 2026
@vaadin-bot vaadin-bot added +0.0.1 and removed +1.0.0 labels Jan 12, 2026
@sonarqubecloud
Copy link
Copy Markdown

@github-actions github-actions Bot added +1.0.0 and removed +0.0.1 labels Jan 12, 2026
Comment thread flow-dnd/src/main/java/com/vaadin/flow/component/dnd/DropEvent.java
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could add a junit test where the DragStartEvent has a non 0 offset value and drag ed event would validate the getDragStartOffsetX and getDragStartOffsetY values.

Artur- added 3 commits May 5, 2026 18:33
# Conflicts:
#	flow-dnd/src/test/java/com/vaadin/flow/component/dnd/DragSourceTest.java
#	flow-dnd/src/test/java/com/vaadin/flow/component/dnd/DropTargetTest.java
…etX/Y

Replaces Optional<Integer> with int returning 0 when no active drag
source, so callers no longer need orElse(0). Also adds a unit test
verifying drag-start offsets propagate to the drop event, and updates
two merge-introduced test calls to the new constructor signatures.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@caalador caalador added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit 55905d7 May 6, 2026
31 checks passed
@caalador caalador deleted the feature/dd-client-xy branch May 6, 2026 07:12
manolo pushed a commit to vaadin/flow-components that referenced this pull request May 7, 2026
TatuLund pushed a commit to TatuLund/vaadin-flow-components that referenced this pull request May 7, 2026
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.2.0-alpha6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic Drag & Drop add drop coordinates

5 participants