dream-num / Luckysheet

Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
https://dream-num.github.io/LuckysheetDocs/
MIT License
15.94k stars 2.37k forks source link

工具栏点击更多,更多的工作栏展示,定位不准确 #1139

Open kkkkh opened 2 years ago

kkkkh commented 2 years ago

问题: 1、案例中luckysheet组建的父元素不是body,而是一个div的容器中,此div设置固定高度并且有滚动条的时候; 2、当点击工具栏更多时,将更多工具栏显示出来时,我发现更多工具栏<div id="luckysheet-icon-morebtn-div">定位不准确,这是因为: 2-1、top的计算是基于 Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop()

2-2、<div id="luckysheet-icon-morebtn-div">是append到body中,以body为父元素,进行定位造成的,而lucksheet的父元素此时不是body;

kkkkh commented 2 years ago

<div width="100%" height="300" style="overflow-y:scroll"> <div height="500" width="100%"></div> <div id="luckysheet"></div> </div>