You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom'react';import{Drawer,DrawerPanelContent,DrawerContent,DrawerContentBody,DrawerHead,DrawerActions,DrawerCloseButton,Button}from'@patternfly/react-core';import{DragDropSort,DraggableObject}from"@patternfly/react-drag-drop";exportconstDrawerInlinePanelStart: React.FunctionComponent=()=>{const[isExpanded,setIsExpanded]=React.useState(true);constdrawerRef=React.useRef<HTMLDivElement>();constonExpand=()=>{drawerRef.current&&drawerRef.current.focus();};constonClick=()=>{setIsExpanded(!isExpanded);};constonCloseClick=()=>{setIsExpanded(false);};const[items,setItems]=React.useState<DraggableObject[]>([{id: 'with-button-1',content: 'one'},{id: 'with-button-2',content: 'two'},{id: 'with-button-3',content: 'three'},{id: 'with-button-4',content: 'four'},{id: 'with-button-5',content: 'five'},{id: 'with-button-6',content: 'six'},{id: 'with-button-7',content: 'seven'},{id: 'with-button-8',content: 'eight'},{id: 'with-button-9',content: 'nine'},{id: 'with-button-10',content: 'ten'},{id: 'with-button-11',content: 'eleven'},{id: 'with-button-12',content: 'twelve'},{id: 'with-button-13',content: 'thirteen'},{id: 'with-button-14',content: 'fourteen'},{id: 'with-button-15',content: 'fifteen'},{id: 'with-button-16',content: 'sixteen'},{id: 'with-button-17',content: 'seventeen'},{id: 'with-button-18',content: 'eighteen'},{id: 'with-button-19',content: 'nineteen'},{id: 'with-button-20',content: 'twenty'},]);constpanelContent=(<DrawerPanelContent><DrawerHead><spantabIndex={isExpanded ? 0 : -1}ref={drawerRef}>drawercontent</span><DrawerActions><DrawerCloseButtononClick={onCloseClick}/></DrawerActions></DrawerHead><DragDropSortitems={items}variant="defaultWithHandle"onDrop={(_,newItems)=>{setItems(newItems);}}/></DrawerPanelContent>);constdrawerContent='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';return(<React.Fragment><Buttonaria-expanded={isExpanded}onClick={onClick}>Toggledrawer</Button><DrawerisExpanded={isExpanded}isInlineposition="start"onExpand={onExpand}><DrawerContentpanelContent={panelContent}><DrawerContentBody>{drawerContent}</DrawerContentBody></DrawerContent></Drawer></React.Fragment>);};exportdefaultDrawerInlinePanelStart;
Describe the problem
I combined the examples for Drag and Drop and Drawer with very few modifications:
How do you reproduce the problem?
https://github.com/jennydaman/patternfly-react-drag-drop-in-drawer
Expected behavior
Dragged element stays under the mouse.
Is this issue blocking you?
It is blocking us from using the Drag and Drop feature, but I can choose to use a different UX instead.
Screenshots
simplescreenrecorder-2024-02-16_15.55.34.mp4
What is your environment?
The text was updated successfully, but these errors were encountered: