had dragged, how to update coverd area

Open
#753 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

Start by reproducing the drag interaction involving Draggable inside Popup and EdgeLabelRenderer, using the provided component structure. Investigate why the Popup's previous area remains covered after dragging; done means the old area is cleared without breaking dragging or the popup display.

Written by the indexing model from the issue text.

Description

image

I use mui Unstable_Popup component that could drag on the react flow component. Its draged well, but the old area of Unstable_Popup remain coverd. How to erase this area? Thks.

return (
<>
    <BaseEdge path={edgePath} markerEnd={markerEnd} style={{stroke:color}} />
    <EdgeLabelRenderer>
        <div
        onClick={handleClick}
        style={{
            position: 'absolute',
            transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,
            fontSize: 12,
            // everything inside EdgeLabelRenderer has no pointer events by default
            // if you have an interactive element, set pointer-events: all
            background: '#ffcc00',
            paddingLeft: 10,
            paddingRight:10,
            paddingTop:4,
            paddingBottom:4,
            borderRadius: 5,
            fontWeight: 700,
            pointerEvents: 'all',
        }}
        className="nopan edgeObject"
        >
            {label}
        </div>
        <Popup id={id} open={open} anchor={anchorEl}>
            <Draggable handle='.handleEdge'>
                <Paper><ForwardPanel handleClose={handleClose} pair={t} {...props} /></Paper>
            </Draggable>
        </Popup>
    </EdgeLabelRenderer>
</>
);
<Paper className='handleEdge' sx={{backgroundColor:pink[50], cursor:'pointer'}} >
    <Stack direction="row" spacing={0.6} display='flex' alignItems='center' padding='4px' borderBottom='1px solid #E8A7D5'>
        <Box whiteSpace='nowrap' overflow='hidden' textOverflow='ellipsis' maxWidth='8em'>{source}</Box> 
        <ArrowForwardIcon sx={{color:grey[400], fontSize:"1em"}}/> 
        <Box whiteSpace='nowrap' overflow='hidden' textOverflow='ellipsis' maxWidth='8em'>{target}</Box>  
        <IconButton onClick={props.handleClose} sx={{marginLeft:'auto !important', padding:"0", fontSize:'1em'}}><CloseIcon color='primary' />  </IconButton >          
    </Stack>
</Paper>        
Dominant language
JavaScript
Stars
9.3k
Forks
1k
Avg merge
3d 8h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-grid-layout/react-draggable

All issues in react-grid-layout/react-draggable

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.