facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
17.5k stars 1.45k forks source link

[lexical-playground][TableCellRecizer] Bug Fix: Correctly take zoom into account when calculating table drag zones #6007

Closed apella closed 1 week ago

apella commented 2 weeks ago

Description

In our implementation of this editor, the user can modify the zoom of the editor area independently of the rest of the page. This skews the selection areas of the table cell resizer. This commit fixes that.

It also slightly shifts the rectangles to center on the edge, instead of being outside the cell, and scales these rectangles proportionally. This makes for a more intuitive user experience as the user will try to select the edge, not the outside.

Closes: #

Test plan

Before

lexical-zoom-original

cell-resizer-old-regions

After

lexical-zoom-fixed

(selection zones were temporarily coloured yellow to display the zones. Notice how they now overlap with the cell border) cell-resizer-new

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2024 11:06am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2024 11:06am
apella commented 1 week ago

Closing this in preference of a more succinct solution suggested by @ebads67