selecto icon indicating copy to clipboard operation
selecto copied to clipboard

If container DIV has zoom value react-selcto not working as expected

Open jebaemanuel opened this issue 1 year ago • 4 comments

Environments

  • Framework name: React
  • Framework version: 17.0.2
  • Component name: React-Selecto
  • Component version:1.13.2
  • Testable Address(optional):

Description

If container DIV has zoom value other than 100%, after dragged inside the container, the drag position showing wrong position.

using zoom and transform property in container DIV not working as expected. If I added transform instead of zoom, the drag position working fine. but UI elements not selected.

I shared the example - in render function. return <div className="app"> <div className="container" style={{zoom:"50%"}}>

    <Selecto 
    	.....
    />

jebaemanuel avatar Aug 04 '22 10:08 jebaemanuel

@jebaemanuel

okay. I'll check it.

daybrush avatar Aug 06 '22 03:08 daybrush

@jebaemanuel

I checked and selecto calculates the position and size through getBoundingClientRect, but the zoom property interferes with this and brings an incorrect value.

How about using transform: scale(0.5) instead?

Set rootConainer={document.body} if selecto is in container with transform applied.

daybrush avatar Aug 06 '22 03:08 daybrush

@jebaemanuel

I checked and selecto calculates the position and size through getBoundingClientRect, but the zoom property interferes with this and brings an incorrect value.

How about using transform: scale(0.5) instead?

Set rootConainer={document.body} if selecto is in container with transform applied.

solution yet?

MuhammadFadhil10 avatar Jun 06 '23 03:06 MuhammadFadhil10

solution yet?

wangchihai avatar Dec 11 '23 11:12 wangchihai