mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 05:11:44 +08:00
UX: only toggle rich editor details on caret click (#32267)
This commit is contained in:
@ -69,7 +69,10 @@ const extension = {
|
||||
plugins: {
|
||||
props: {
|
||||
handleClickOn(view, pos, node, nodePos) {
|
||||
if (node.type.name === "summary") {
|
||||
if (pos > 2 || node.type.name !== "summary") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const details = view.state.doc.nodeAt(nodePos - 1);
|
||||
view.dispatch(
|
||||
view.state.tr.setNodeMarkup(nodePos - 1, null, {
|
||||
@ -77,7 +80,6 @@ const extension = {
|
||||
})
|
||||
);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user