Dashibase / lotion

An open-source Notion UI built with Vue 3
GNU General Public License v3.0
2.79k stars 132 forks source link

fix: block conversion issues #33

Closed vvidday closed 2 years ago

vvidday commented 2 years ago

Proposed solutions for #27 and #29

For #27, Block.vue::clearSearch previously wouldn't trigger on a single slash since the slash was not added to searchTerm. Also changed <= 1 to <1 to support single character search terms (e.g. /h)

For #29 please see issue

27 ![27-before](https://user-images.githubusercontent.com/45852430/182354053-44d0b10a-f9aa-44f0-be52-f9e5bc2f6687.gif) ![27-after](https://user-images.githubusercontent.com/45852430/182354066-4541a060-9732-434d-8eb4-90a83e9d3a6c.gif)
29 ![29-before](https://user-images.githubusercontent.com/45852430/182353990-6666bfbb-1e7d-4f28-b0f1-88a2d0422cd4.gif) ![29-after](https://user-images.githubusercontent.com/45852430/182354007-8a807c15-ceb0-4d9e-9e32-dc3e6c2021d6.gif)
vvidday commented 2 years ago

regarding the last commit, here's a gif showing the content of selectedNode in getCaretPos:

27misc

when it's a single character it returns the parent node instead of the text node, so selectedNode is wrong and results in the wrong offset.