Fix element position when dragged in homepage customizer

This commit is contained in:
Raphael Wickihalder 2022-04-03 15:19:05 +02:00
parent b7b27136fd
commit a6169a80a9
No known key found for this signature in database
GPG key ID: 05179BB92383243D
2 changed files with 8 additions and 5 deletions

View file

@ -122,7 +122,8 @@ export default function HomepageSort(props: Props) {
// $FlowFixMe // $FlowFixMe
draggableProvided.draggableProps.style.left = draggedItemRef.offsetLeft; draggableProvided.draggableProps.style.left = draggedItemRef.offsetLeft;
// $FlowFixMe // $FlowFixMe
draggableProvided.draggableProps.style.top = draggedItemRef.offsetTop; // draggableProvided.draggableProps.style.top = draggedItemRef.offsetTop;
draggableProvided.draggableProps.style.top = draggableProvided.draggableProps.style.top - 50;
} }
return ( return (
<div <div

View file

@ -9,18 +9,19 @@
background-color: var(--color-ads-background); background-color: var(--color-ads-background);
padding: var(--spacing-s); padding: var(--spacing-s);
margin-right: var(--spacing-s); margin-right: var(--spacing-s);
border: 1px solid var(--color-border);
overflow: auto; overflow: auto;
overflow-x: hidden; overflow-x: hidden;
border-radius: var(--border-radius);
outline: 1px solid var(--color-border);
} }
.homepage-sort__bin--dashed { .homepage-sort__bin--dashed {
border: dashed var(--color-border); outline: dashed var(--color-border);
} }
.homepage-sort__bin--highlight { .homepage-sort__bin--highlight {
border-color: var(--color-primary); outline-color: var(--color-primary);
border-width: 2px; outline-width: 2px;
} }
.homepage-sort__bin--no-bg { .homepage-sort__bin--no-bg {
@ -42,6 +43,7 @@
padding: var(--spacing-xs) var(--spacing-m) var(--spacing-xs) var(--spacing-m); padding: var(--spacing-xs) var(--spacing-m) var(--spacing-xs) var(--spacing-m);
align-items: center; align-items: center;
font-size: var(--font-small); font-size: var(--font-small);
border-radius: var(--border-radius);
svg { svg {
margin-top: var(--spacing-xxs); margin-top: var(--spacing-xxs);