Skip to content

Commit

Permalink
fix(editable): change drag handle to be on top part only (#1475)
Browse files Browse the repository at this point in the history
Co-authored-by: seaerchin <[email protected]>
  • Loading branch information
seaerchin and seaerchin authored Sep 7, 2023
1 parent 0385f1b commit b1fb23c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/layouts/components/ContactUs/LocationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export const LocationCard = ({
isEmpty={frontMatter.operating_hours.length === 0}
>
<Editable.Accordion>
{/* Note: contentEditable is required to stop drag and drop
from hitting the first level drag and drop */}
<VStack p={0} spacing="0.75rem" contentEditable>
<VStack p={0} spacing="1.125rem">
{frontMatter.operating_hours.map(
(operatingHour, operatingHourIndex) => (
<Editable.DraggableAccordionItem
Expand Down
3 changes: 2 additions & 1 deletion src/layouts/components/Editable/Editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const DraggableAccordionItem = ({
borderRadius={isNested ? "0.375rem" : "0.5rem"}
{...draggableProvided.draggableProps}
ref={draggableProvided.innerRef}
{...draggableProvided.dragHandleProps}
boxShadow="sm"
position="relative"
>
{({ isExpanded }) => (
Expand Down Expand Up @@ -379,6 +379,7 @@ const DraggableAccordionItem = ({
borderRadius: isNested ? "0.375rem" : "0.5rem",
}}
bgColor="none"
{...draggableProvided.dragHandleProps}
>
{isNested && (
<IconButton
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/components/NavBar/GroupMenuBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export const GroupMenuBody = ({
<Editable.Accordion>
<VStack p={0} spacing="1.25rem">
{sublinks.map((sublink, sublinkIndex) => (
// Note: contentEditable is required to stop drag and drop from hitting the first level drag and drop
<VStack contentEditable w="100%">
<VStack w="100%">
<Editable.DraggableAccordionItem
draggableId={`sublink-${index}-${sublinkIndex}-draggable`}
index={sublinkIndex}
Expand Down

0 comments on commit b1fb23c

Please sign in to comment.