Luckysheet [BUG]工具栏上的公式编辑器不支持跨页面

4nkexdtk  于 22天前  发布在  其他
关注(0)|答案(1)|浏览(18)

Describe the bug
工具栏上的公式编辑器,输入“=”,切换到其他sheet页面,鼠标点选一个单元格(如A1),不起作用

To Reproduce
Steps to reproduce the behavior:

  1. 打开luckysheet的demo,任意选择单元格
  2. 在工具栏的公式编辑器里面输入“=”
  3. 切换到另外一个sheet页面,鼠标点选单元格A1
  4. 公式无法变为“=A1”

What is expected?
希望切换sheet页面,点选A1单元格,公式可以变为“=A1”

Screenshots or demo
1611831463838225.mp4

Environment

  • OS: [e.g. Windows,Mac,Linux]
  • Browser Version: [e.g. Chrome Version 84.0.4147.105 (Official Build) (64-bit), Safari,Firefox,Edge]
  • Luckysheet Version: [e.g. 1.0.1,latest]

Additional context
Add any other context about the problem here.

w46czmvw

w46czmvw1#

经过排查,发现时formula.js里面的israngeseleciton方法存在问题。
此方法里面通过currSelection = window.getSelection()来获取当前光标所在位置
但是切换sheet页面的时候,会导致光标丢失,因此导致currSelection无法正确获取位置
目前的解决办法是在切换sheet的时候,重新定位一下光标,期待官方更好的解决办法。

相关问题