Open rceraline opened 3 years ago
I had this problem too but didn't realize this was the cause!
I was able to workaround it adding a tunneled 'contextmenu' event listener on window and rejecting the right click if a cell is selected and the mouse point on the click is NOT in the table's <tbody>
element's (specifically that element any higher will return the whole block width) bounding client rect. using getBoundingClientRect()
and {x: e.clientX, y: e.clientY}
for the collision detected.
I solved the problem by adding the line
if(!cellNode)
return true;
After
const cellNode = path.filter(node => {
return node.tagName &&
node.tagName.toUpperCase() === 'TD' &&
node.getAttribute('data-row')
})[0]
Inside the Listener
this.quill.root.addEventListener('contextmenu', (evt) => {
Hi,
I noticed an error when using the table. Here is the repro steps:
Expected behavior: no error Actual behavior: Cannot read properties of undefined (reading 'getBoundingClientRect')
The scenario can be reproduced here: https://codepen.io/soccerloway/pen/WWJowj