When selecting text inside table cells, then the selection propagates to the cell, then the browser tab completely freeze.
It happens only when :
having a trumbowyg initialized on page
having a table drawn on page
And when selecting cells which have colspan attribute containing NaN value (supposed same behavior with rowspanattribute).
In my case, I'm using Mustache JS for templating views which causing the problem with my template row.
Bug case
When selecting text inside table cells, then the selection propagates to the cell, then the browser tab completely freeze.
It happens only when :
colspan
attribute containing NaN value (supposed same behavior withrowspan
attribute). In my case, I'm using Mustache JS for templating views which causing the problem with my template row.My template row is as follow :
The bug come from the
while
loop at line 533 oftrumbowyg.table.min.js
:So, in my case my colspan attribute is NaN value
{{^mustache_condition}}2{{/mustache_condition}}
.Checking if
!isNaN(colspanAttr)
in ternary line 530 oftrumbowyg.table.min.js
resolves the issue. (supposed same behavior withrowspan
attribute)Maybe add scope on selection only on table inside a trumbowyg element could be a nicer solution?
Description
Context:
How to reproduce?
Here's a fiddle to reproduce the error : https://jsfiddle.net/wqk2xLjr/10/