Skip to content

Commit

Permalink
Pass first supportedAction as the action to exportAsDrag in desktop…
Browse files Browse the repository at this point in the history
… DnD implementation.
  • Loading branch information
m-sasha committed Nov 6, 2024
1 parent e7dfb92 commit cd8d782
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
package androidx.compose.mpp.demo.components

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.draganddrop.dragAndDropSource
import androidx.compose.foundation.draganddrop.dragAndDropTarget
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -56,7 +54,7 @@ import java.awt.datatransfer.StringSelection
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@OptIn(ExperimentalFoundationApi::class, ExperimentalComposeUiApi::class)
@OptIn(ExperimentalComposeUiApi::class)
@Composable
actual fun DragAndDropExample() {
val exportedText = "Hello, DnD!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,9 @@ internal class ComposeTransferHandler(private val rootContainer: JComponent) : T
0,
false
),
// This seems to be ignored, and the initial action is MOVE regardless
MOVE
// This seems to be ignored, other than verifying that it's one of the flags returned in
// `getSourceActions`
transferData.supportedActions.first().awtAction
)
}

Expand Down

0 comments on commit cd8d782

Please sign in to comment.