瀏覽代碼

Table: showOverflowTooltip compatibility with IE11 (#11225)

杨奕 7 年之前
父節點
當前提交
696beba0b9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/table/src/table-body.js

+ 1 - 1
packages/table/src/table-body.js

@@ -347,7 +347,7 @@ export default {
       const rangeWidth = range.getBoundingClientRect().width;
       const padding = (parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +
         (parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0);
-      if (rangeWidth + padding > cellChild.offsetWidth && this.$refs.tooltip) {
+      if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
         const tooltip = this.$refs.tooltip;
         // TODO 会引起整个 Table 的重新渲染,需要优化
         this.tooltipContent = cell.textContent || cell.innerText;