@@ -620,7 +620,7 @@ export default defineComponent({
620620 this .calStickyLeft ()
621621 }, 200 )
622622
623- if (ResizeObserver) new ResizeObserver (this .winResize ).observe (this .tableContent )
623+ if (ResizeObserver) new ResizeObserver (this .winResize ).observe (this .editor )
624624 window .addEventListener (' resize' , this .winResize )
625625 window .addEventListener (' paste' , this .winPaste )
626626 window .addEventListener (' keydown' , this .winKeydown )
@@ -1777,14 +1777,16 @@ export default defineComponent({
17771777 this .hScroller .scrollerUnseenWidth = this .footer .getBoundingClientRect ().width - this .numColWidth - scrollerWidth
17781778 }
17791779
1780- let outerElement = this .editor . parentElement
1780+ let outerElement = this .editor
17811781 let bottomOffset = 0
1782- while (outerElement && ! outerElement .style .height && outerElement .style .height !== ' auto' ) {
1783- const style = getComputedStyle (outerElement)
1784- bottomOffset += parseInt (style .marginBottom )
1785- bottomOffset += parseInt (style .paddingBottom )
1786- bottomOffset += parseInt (style .borderBottomWidth )
1787- outerElement = outerElement .parentElement
1782+ if (this .height !== ' auto' ) {
1783+ while (outerElement && ! outerElement .style .height && outerElement .style .height !== ' auto' ) {
1784+ const style = getComputedStyle (outerElement)
1785+ bottomOffset += parseInt (style .marginBottom )
1786+ bottomOffset += parseInt (style .paddingBottom )
1787+ bottomOffset += parseInt (style .borderBottomWidth )
1788+ outerElement = outerElement .parentElement
1789+ }
17881790 }
17891791 if (outerElement) {
17901792 const style = getComputedStyle (outerElement)
@@ -1800,8 +1802,15 @@ export default defineComponent({
18001802 let controlHeight = outerHeight - (this .recordBody .getBoundingClientRect ().top - outerTop) - offset
18011803
18021804 if (this .height ) {
1803- const height = parseInt (this .height ) + this .systable .getBoundingClientRect ().top - this .recordBody .getBoundingClientRect ().top
1804- if (controlHeight > height) controlHeight = height
1805+ if (this .height === ' auto' ) {
1806+ const p = this .editor .parentElement
1807+ if (p && p .scrollHeight > p .clientHeight )
1808+ controlHeight += p .clientHeight - p .scrollHeight
1809+ }
1810+ else {
1811+ const height = parseInt (this .height ) + this .systable .getBoundingClientRect ().top - this .recordBody .getBoundingClientRect ().top
1812+ if (controlHeight > height) controlHeight = height
1813+ }
18051814 }
18061815 this .pageSize = this .page || Math .floor (controlHeight / 24 )
18071816 }
0 commit comments