@pie-lib/editable-html-tip-tap 1.2.0-next.23 → 1.2.0-next.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,12 +230,20 @@ export const MathNodeView = (props) => {
230
230
  !!(target?.id && target.id.includes('equation-editor-select')) ||
231
231
  !!target?.closest?.('[id*="equation-editor-select"]');
232
232
 
233
+ // If the click originated from the math node preview itself (the element
234
+ // that opens the toolbar), ignore it here — the node's own onClick handler
235
+ // will keep/re-open the toolbar. Without this guard, closing and then
236
+ // immediately clicking the math node would fire this listener in the same
237
+ // event cycle and close the toolbar before it could open.
238
+ const clickedMathNode = !!target?.closest?.('.math-node');
239
+
233
240
  if (
234
241
  toolbarRef.current &&
235
242
  !toolbarRef.current.contains(target) &&
236
243
  !target?.closest?.('[data-inline-node]') &&
237
244
  !equationEditorPopoverOpen &&
238
- !clickedEquationEditorSelect
245
+ !clickedEquationEditorSelect &&
246
+ !clickedMathNode
239
247
  ) {
240
248
  setShowToolbar(false);
241
249
  }