Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
3.96k stars 606 forks source link

Unable to resize table with v2.28.0 #1451

Open benji07 opened 3 months ago

benji07 commented 3 months ago

I got a really strange bug. when adding the table plugin on my website, i'm not able to resize columns.

the targetColumnIndex variable is always undefined

Description

OS: MacOS 14.4.1 Browser: Chrome 123 Trumbowyg version 2.28.0 jQuery 3.6.1

How to reproduce?

Install a project with jquery 3.4.1 & Trumbowyg 2.28.0

I tried to install the previous version 2.27.3 and it work fine (i tried to understand the diff between the 2 versions but i can't https://github.com/Alex-D/Trumbowyg/compare/v2.27.3...v2.28.0#diff-80f5b33ad4d28d0e5a6123c43c5e1278c104ad649431efb86b7bbbc76a70dd7bR1259)

zymbth commented 3 days ago

I met this bug too #1474, and I tried to fix it #1473. I think the reason is the variables (tableState, targetColumnIndex, $table) used in mouse events come from different closures (caused by hasResizeLayers).

By the way, v2.27.3 will recreate resizeLayer over and over again.