Review main Abandoned

91667[BUGFIX] Correction of moving and copying of content elements

Dennis Purisevic CR -1 V +1 Easy +3 −12 updated 11/26/25, 18:36

Commit message

Since version 13.4.8, the default behavior when moving content has been changed to copying. This is misleading, as most users want to move content rather than copy it (most of the time). This resets the default behavior back to and implements the Hotkeys API to check for a copy command.

Review

  • Code review CR -1
    • Friedemann Altrock -1
  • Verified V +1
    • Jonas Eberle +1
    • core-ci +1 CI

Issues 4

Files 2

Review log 1417

  1. Dennis Purisevic uploaded patch set 1 11/14/25, 12:44

  2. core-ci voted on patch set 1 V +1 11/14/25, 12:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89689

  3. Dennis Purisevic updated the commit message in patch set 2 V +1 11/14/25, 13:24

  4. core-ci voted on patch set 2 V +1 11/14/25, 13:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89691

  5. Max Frerichs commented on patch set 2 11/14/25, 15:20

    drag-drop-utility.ts:24

    I'm not sure about your intention here, as the expression in line 24 is not a workaround to the issue described in #107970. This expression evaluates the dropEffect property (which is currently broken because of the regression in Chromium), thus causing the expression to evaluate to "true" - even if you don't want to copy an element. The workaround could be evaluating modifier keys and setting the dropEffect property depending on modifier keys - as you're doing in line 28 - so, it does fix the bug. :-) IMHO the evaluation of modifier keys should happen in DragDropUtility.isCopyModifierFromEvent(), so you can reuse it.
  6. Dennis Purisevic commented on patch set 2 11/14/25, 15:49

    drag-drop-utility.ts:24 Reply

    The problem was that the browsers dropEffect won't be set to move. This patch removes the browsers evaluation completely. So I don't consider this a workaround, but rather a better/cleaner implementation, since we don't call “isCopyModifierFromEvent” twice in a row and it's more readable. Yes, I see that the evaluation can be placed within the isCopyModifierFromEvent method, but the method is called after updateEventAndTooltipToReflectCopyMoveIntention has been called to there is no need to check it again. Can you give me an example so that I can better understand your point of view?
  7. Max Frerichs commented on patch set 2 11/14/25, 17:02

    drag-drop-utility.ts:24 Reply

    Ah, I see - it's not intended as workaround, but to improve readability. Thanks for explaining. :-) Regarding my suggestion: When you look into isCopyModifierFromEvent, evaluation of event data happens here to determine the correct action - which is fine. This evaluation now also happens in updateEventAndTooltipToReflectCopyMoveIntention, although slightly different - which seems to work fine, but it is a bit confusing. For this reason I think, the better approach would be doing the evaluation only once in isCopyModifierFromEvent and updating the event itself in updateEventAndTooltipToReflectCopyMoveIntention based on what isCopyModifierFromEvent is returning. I hope I was able to explain my point of view clearly.
  8. Friedemann Altrock commented on patch set 2 CR -1 11/17/25, 19:34

    I do not think event.dataTransfer.dropEffect can be relied on to have a consistent cross-platform behavior. Browsers currently interpret the HTML specification differently.

    drag-drop-utility.ts:28

    `getModifierState` expects the key name to be Capitalized, `normalizedCtrlModifierKey` is all lowercase though. This call will always return `false`.
  9. Dennis Purisevic uploaded patch set 3 CR -1 V +1 11/20/25, 10:47

  10. Dennis Purisevic commented on patch set 3 11/20/25, 10:53

    Reply

    The `event.dataTransfer.dropEffect` property is only set in the `updateEventAndTooltipToReflectCopyMoveIntention` method. Therefore, if a copy or move operation is desired, this is not checked by the `dropEffect` property, but by the `isCopyModifierFromEvent` method.

    drag-drop-utility.ts:28 Reply

    Changed it quite a bit and made it simpler. Removed the `getModifierState` and used the `event.altKey` and `event.ctrlKey` to check for a copy command. Tested it on Safari, Firefox and Chrome on Mac.
  11. core-ci voted on patch set 3 V +1 11/20/25, 10:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90261

  12. Friedemann Altrock commented on patch set 3 11/21/25, 12:03

    Hi Dennis, I like the latest version of this patch. Is it OK if I integrate your change into https://review.typo3.org/c/Packages/TYPO3.CMS/+/91580 so we can focus on one patch?
  13. Dennis Purisevic commented on patch set 3 11/21/25, 15:18

    Reply

    Yes, of course, no problem. But if you don't want to make any further changes, I'm not sure if that would mean more work :D.
  14. Jonas Eberle voted on patch set 3 V +1 11/26/25, 11:14

  15. Friedemann Altrock commented on patch set 3 CR -1 11/26/25, 12:47

    Reply

    Hi Dennis, quick update here: after thinking about a bit, IMO pulling in a dependency on the Hotkey module is not the way to go here. I will do review -1 on this, in favor of Max's change (91580). The platform detection is orthogonal (aka unrelated) and should probably live in a separate file anyway. We can open a new change to unify the Mac platform check form both the hotkey module and the drag & drop utility.
  16. Dennis Purisevic commented on patch set 3 11/26/25, 14:05

    Reply

    I don't see a problem with the Hotkey API dependency. I could move the check directly into DragDropUtility, but I'm not sure if that's better. Yes, the platform check could be contained in its own API, but I'm not sure. This patch fixes the regression from 13.4.8, which ultimately fixes the Chrome bug that then conflicts with Max's changes. Since this is too much discussion for this bug fix, I will merge my changes into 91580, change the commit message, and abandon this change, as a longer discussion takes more time than it should.
  17. Dennis Purisevic abandoned the change 11/26/25, 18:36

    Conflict with 91580