selecto icon indicating copy to clipboard operation
selecto copied to clipboard

will-change: transform 导致选择框位置错误

Open fanterxissss opened this issue 2 years ago • 5 comments

@daybrush container包含的元素,不能使用css : will-change: transform; 加了这个css属性就会选择框位置translate计算错误。 # #

fanterxissss avatar May 05 '22 11:05 fanterxissss

@fanterxissss

Use rootContainer option for no transformed parent container. (ex: document.body)

daybrush avatar May 06 '22 17:05 daybrush

rootContainer 不能解决这个问题,直到我删除了这个css属性,才得以解决,

fanterxissss avatar May 07 '22 07:05 fanterxissss

@fanterxissss

https://codesandbox.io/s/vigorous-kare-dh09jo?file=/src/index.ts

I feel like this, is there any difference with your code?

If so, can you show me your html structure? And what is the container to which the transform is applied and the container set as the rootContainer?

daybrush avatar May 08 '22 02:05 daybrush

@daybrush container包含的元素,不能使用css : will-change: transform; 加了这个css属性就会选择框位置translate计算错误。 # #

检查一下,你的container 是否有包含transform-style: preserve-3d,或transform相关的属性,demo就是有 transform-style 才有问题的

meibin08 avatar May 24 '22 10:05 meibin08

请问你最后问题解决了吗?我的父容器加了transform: scale,框选时位置就计算错误了

hqiaozhang avatar Sep 28 '23 05:09 hqiaozhang