Minimal fix for missed pointerup after drug in Safari#3011
Merged
Shagen Ogandzhanian (Schahen) merged 1 commit intoApr 24, 2026
Conversation
Copilot started reviewing on behalf of
Shagen Ogandzhanian (Schahen)
April 24, 2026 12:56
View session
There was a problem hiding this comment.
Pull request overview
Fixes a Safari-specific pointer state issue after drag-and-drop where pointerup may not fire, leaving Compose Web input state inconsistent and causing the next click to be ignored.
Changes:
- Add a global
"dragend"listener in the WebComposeWindowto resetactualActivePointerButtonswhen Safari missespointerup. - Update the Web drag-and-drop demo to start with the target enabled by default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| compose/ui/ui/src/webMain/kotlin/androidx/compose/ui/window/ComposeWindowInternal.web.kt | Resets tracked mouse button state on global dragend to mitigate Safari missing pointerup after DnD. |
| compose/mpp/demo/src/webMain/kotlin/androidx/compose/mpp/demo/components/DragAndDropExample.web.kt | Changes initial demo state so the DnD target is enabled by default on Web. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| state.globalEvents.addDisposableEvent("dragend") { | ||
| // in Safari pointerup event is not firing when we drop or cancel drop |
Comment on lines
+391
to
+395
| state.globalEvents.addDisposableEvent("dragend") { | ||
| // in Safari pointerup event is not firing when we drop or cancel drop | ||
| // see https://youtrack.jetbrains.com/issue/CMP-10102 | ||
| actualActivePointerButtons = null | ||
| } |
| val exportedText = "Hello, DnD!" | ||
|
|
||
| var isTargetEnabled by remember { mutableStateOf(false) } | ||
| var isTargetEnabled by remember { mutableStateOf(true) } |
Konstantin (terrakok)
approved these changes
Apr 24, 2026
Ekaterina Zaitseva (sekater)
added a commit
that referenced
this pull request
Apr 24, 2026
🍒 Cherry-pick of a51049b This is the most possible non-invasive way to fix the bug that exists in safari with processing pointer events after drag cancellation manual - [CMP-10102](https://youtrack.jetbrains.com/issue/CMP-10102) [Web] Safari. DragAndDrop. After performing drag and drop operations buttons are unclickable on the first attempt Describe proposed changes and the issue being fixed (Optional) Fixes [link to the issue] ## Testing manual ## Release Notes ### Fixes - Web - [CMP-10102](https://youtrack.jetbrains.com/issue/CMP-10102) [Web] Safari. DragAndDrop. After performing drag and drop operations buttons are unclickable on the first attempt
Sajid Ali (sajidalidev)
pushed a commit
to sajidalidev/compose-multiplatform-core-tvos
that referenced
this pull request
May 6, 2026
This is the most possible non-invasive way to fix the bug that exists in safari with processing pointer events after drag cancellation manual - [CMP-10102](https://youtrack.jetbrains.com/issue/CMP-10102) [Web] Safari. DragAndDrop. After performing drag and drop operations buttons are unclickable on the first attempt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the most possible non-invasive way to fix the bug that exists in safari with processing pointer events after drag cancellation
Testing
manual
Release Notes
Fixes - Web