WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
267811
Dragging of <tr>s that are position: absolute and have a translate applied erroneously uses the image of the first row
https://bugs.webkit.org/show_bug.cgi?id=267811
Summary
Dragging of <tr>s that are position: absolute and have a translate applied er...
Jeroen Zwartepoorte
Reported
2024-01-20 04:46:11 PST
Created
attachment 469479
[details]
Video of the behavior in Safari 17.2.1 Given a table with `<tr draggable="true" style="translate: 0 0px">` style table rows, dragging the rows is broken in Safari. Try dragging the second row in this codepen:
https://codepen.io/jpzwarte/pen/xxBrbNq
Works fine in Chromium and FF, but in WebKit, you're not dragging the "Ipsum" row, but instead WebKit always starts dragging the first "Lorem" row. See the video with the behavior in action.
Attachments
Video of the behavior in Safari 17.2.1
(2.37 MB, video/mp4)
2024-01-20 04:46 PST
,
Jeroen Zwartepoorte
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Jeroen Zwartepoorte
Comment 1
2024-01-22 01:54:05 PST
Found this code in the Vaadin grid component: ``` if (this._safari) { // Safari doesn't position drag images from transformed // elements properly so we need to switch to use top temporarily const transform = row.style.transform; row.style.top = /translateY\((.*)\)/.exec(transform)[1]; row.style.transform = 'none'; requestAnimationFrame(() => { row.style.top = ''; row.style.transform = transform; }); } ``` So it's been known a while.
Jeroen Zwartepoorte
Comment 2
2024-01-22 02:44:04 PST
There is one more line necessary to fix Safari: event.dataTransfer!.setDragImage(row, event.clientX - rowRect.left, event.clientY - rowRect.top); Where event is the DragEvent and rowRect is the bounding client rect of the dragged row. Without this line, Safari will still animate the dragged row from the top of the <tbody>. So to summarise: you can fix the Safari behavior by: 1. Temporarily replace translateY with top 2. Explicitly set the drag image
Radar WebKit Bug Importer
Comment 3
2024-01-22 10:48:30 PST
<
rdar://problem/121382647
>
Taher
Comment 4
2025-06-17 04:55:55 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/46845
EWS
Comment 5
2025-06-18 12:55:34 PDT
Committed
296395@main
(860e78e7dd0a): <
https://commits.webkit.org/296395@main
> Reviewed commits have been landed. Closing PR #46845 and removing active labels.
Simon Fraser (smfr)
Comment 6
2025-07-03 12:57:27 PDT
This was reverted in
https://commits.webkit.org/296985@main
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug