daybrush / selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
https://daybrush.com/selecto
MIT License
2k stars 81 forks source link

Selecto Drag effect not in pointer position #135

Open MuhammadFadhil10 opened 1 year ago

MuhammadFadhil10 commented 1 year ago

Environments

Description

selecto drag effect is far from pointer when the selecto container is scaled?

daybrush commented 1 year ago

Could you try setting the rootContainer to no scaled container?

<div class="container" style={{
  transform: "scale(1.5)"
}}>
<Selecto
    rootCotnainer={document.body}

/>
</div>
MuhammadFadhil10 commented 1 year ago

Its still same, here's my code:

demo video:

https://github.com/daybrush/selecto/assets/82107511/37333090-675a-4a89-abb6-210164b4a3f8

daybrush commented 1 year ago

@MuhammadFadhil10

Could you try using transform: scale(value) instead of the scale property?

daybrush commented 1 year ago

@MuhammadFadhil10

If it doesn't work, is there any codesandbox I can test?

MuhammadFadhil10 commented 1 year ago

@MuhammadFadhil10

Could you try using transform: scale(value) instead of the scale property?

this is work, now the selecto effect back to normal

hqiaozhang commented 10 months ago

I also encountered the same problem, but using transform: scale (value) install of the scale property? Failed to solve the problem

daybrush commented 10 months ago

@hqiaozhang

So did you use rootContainer together?

Transform should not be used outside of the rootContainer.