selecto
selecto copied to clipboard
will-change: transform 导致选择框位置错误
@daybrush container包含的元素,不能使用css : will-change: transform; 加了这个css属性就会选择框位置translate计算错误。 # #
@fanterxissss
Use rootContainer
option for no transformed parent container. (ex: document.body)
rootContainer 不能解决这个问题,直到我删除了这个css属性,才得以解决,
@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 container包含的元素,不能使用css : will-change: transform; 加了这个css属性就会选择框位置translate计算错误。 # #
检查一下,你的container 是否有包含transform-style: preserve-3d
,或transform
相关的属性,demo就是有 transform-style
才有问题的
请问你最后问题解决了吗?我的父容器加了transform: scale,框选时位置就计算错误了