mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 17:54:37 +00:00
fixed: Fixed tooltip issue with switch button
This commit is contained in:
@@ -26,7 +26,8 @@ Object.assign(Table.components.TableBody.methods, {
|
|||||||
const range = document.createRange()
|
const range = document.createRange()
|
||||||
range.setStart(cellChild, 0)
|
range.setStart(cellChild, 0)
|
||||||
range.setEnd(cellChild, cellChild.childNodes.length)
|
range.setEnd(cellChild, cellChild.childNodes.length)
|
||||||
const rangeWidth = range.getBoundingClientRect().width
|
// rangeWidth 有可能是小数,因此就会导致原本 rangeWidth + padding = cellChild.offsetWidth 的大于了 cellChild.offsetWidth
|
||||||
|
const rangeWidth = Math.floor(range.getBoundingClientRect().width)
|
||||||
const padding = (parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +
|
const padding = (parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +
|
||||||
(parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0)
|
(parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0)
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user