mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
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:
@ -69,7 +69,8 @@ const extension = {
|
|||||||
plugins: {
|
plugins: {
|
||||||
props: {
|
props: {
|
||||||
handleClickOn(view, pos, node, nodePos) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user