Skip to content

A platform for community discussion. Free, open, simple.

FIX: ensures small actions don't trigger post toolbar (#33422)

Joffrey JAFFEUX732c0f47af4b
diff --git a/app/assets/javascripts/discourse/app/components/post-text-selection.gjs b/app/assets/javascripts/discourse/app/components/post-text-selection.gjs
index 49b50bf8d3b..a27604833fb 100644
--- a/app/assets/javascripts/discourse/app/components/post-text-selection.gjs
+++ b/app/assets/javascripts/discourse/app/components/post-text-selection.gjs
@@ -241,7 +241,15 @@ export default class PostTextSelection extends Component {
return;
}
- return getElement(range.commonAncestorContainer)?.closest?.(".cooked");
+ const cooked = getElement(range.commonAncestorContainer)?.closest?.(
+ ".cooked"
+ );
+
+ if (cooked.closest(".small-action")) {
+ return;
+ }
+
+ return cooked;
}
get post() {