FIX: click handler position on rich editor details node (#32268)

`pos` is the exact position of the click in the entire document

`nodePos` is the position of the clicked node itself

The idea is that we want the click to be the first position **within the
node**.

The previous code was checking for the first 2 positions of the entire
document.

I'd love to add a test for this, but it's very tricky.
This commit is contained in:
Renato Atilio
2025-04-14 14:06:54 -03:00
committed by GitHub
parent b9cef22c2f
commit 381f6e64e8

View File

@ -69,7 +69,8 @@ const extension = {
plugins: {
props: {
handleClickOn(view, pos, node, nodePos) {
if (pos > 2 || node.type.name !== "summary") {
// if the click position in the document is not the first within the summary node
if (pos > nodePos + 1 || node.type.name !== "summary") {
return false;
}