Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Frontend V2
Merge requests
!147
Fix/safari drag
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix/safari drag
fix/safari-drag
into
main
Overview
1
Commits
2
Pipelines
2
Changes
2
Merged
Leonardo Christino
requested to merge
fix/safari-drag
into
main
9 months ago
Overview
1
Commits
2
Pipelines
2
Changes
2
Expand
0
0
Merge request reports
Compare
main
version 1
d6ce297b
9 months ago
main (base)
and
latest version
latest version
700ee586
2 commits,
9 months ago
version 1
d6ce297b
2 commits,
9 months ago
2 files
+
24
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
libs/shared/lib/components/pills/Pill.tsx
+
19
−
1
Options
@@ -56,8 +56,26 @@ export const Pill = React.memo((props: PillI) => {
clipPath
:
corner
===
'
diamond
'
?
'
polygon(0% 50%, 5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%)
'
:
''
,
};
const
onDragStart
=
(
event
:
React
.
DragEvent
<
HTMLDivElement
>
)
=>
{
const
pill
=
event
.
target
as
HTMLDivElement
;
const
dragImage
=
pill
.
cloneNode
(
true
)
as
HTMLDivElement
;
dragImage
.
style
.
transform
=
'
translate(0, 0)
'
;
// Removes the background from drag image in Chrome
document
.
body
.
appendChild
(
dragImage
);
const
mouse_x
=
event
.
clientX
-
pill
.
getBoundingClientRect
().
left
;
const
mouse_y
=
event
.
clientY
-
pill
.
getBoundingClientRect
().
top
;
event
.
dataTransfer
.
setDragImage
(
dragImage
,
mouse_x
,
mouse_y
);
event
.
dataTransfer
.
setData
(
'
mouse_x
'
,
String
(
mouse_x
))
event
.
dataTransfer
.
setData
(
'
mouse_y
'
,
String
(
mouse_y
))
setTimeout
(()
=>
{
dragImage
.
remove
();
},
1
);
}
return
(
<
div
className
=
{
(
props
.
className
?
props
.
className
+
'
'
:
''
)
+
'
flex flex-row flex-grow-0 text-xs text-justify
'
}
>
<
div
draggable
=
"true"
onDragStart
=
{
onDragStart
}
className
=
{
(
props
.
className
?
props
.
className
+
'
'
:
''
)
+
'
flex flex-row flex-grow-0 text-xs text-justify
'
}
>
<
div
className
=
{
'
bg-secondary-200
'
+
(
corner
!==
'
square
'
?
'
rounded
'
:
''
)
}
style
=
{
{
Loading