aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DiagramBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-02-11 16:03:29 -0500
committerbobzel <zzzman@gmail.com>2025-02-11 16:03:29 -0500
commit3e531aa898492cb05e25081f422bb59adab72e8e (patch)
tree29f23fa2619cf4d9aca71f455a0e5724c52bd57a /src/client/views/nodes/DiagramBox.tsx
parent1ef0a2d7835c9dfa1ec9fc298562f3a052b3e817 (diff)
enabled multi-select modification of text documents from topBar buttons. fixed diagram box layout and scrolling. fixed problem with createDoc tool where it would fail when it got an array. fixed formatting of chat box errors.
Diffstat (limited to 'src/client/views/nodes/DiagramBox.tsx')
-rw-r--r--src/client/views/nodes/DiagramBox.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/nodes/DiagramBox.tsx b/src/client/views/nodes/DiagramBox.tsx
index ea3ab2887..e77cde431 100644
--- a/src/client/views/nodes/DiagramBox.tsx
+++ b/src/client/views/nodes/DiagramBox.tsx
@@ -32,6 +32,7 @@ export class DiagramBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
}
return false;
};
+ _boxRef: HTMLDivElement | null = null;
constructor(props: FieldViewProps) {
super(props);
@@ -184,9 +185,24 @@ export class DiagramBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
return '( )';
};
+ /**
+ * This stops scroll wheel events when they are used to scroll the face collection.
+ */
+ onPassiveWheel = (e: WheelEvent) => e.stopPropagation();
+
render() {
return (
- <div className="DIYNodeBox">
+ <div
+ className="DIYNodeBox"
+ style={{
+ pointerEvents: this._props.isContentActive() ? undefined : 'none',
+ }}
+ ref={action((ele: HTMLDivElement | null) => {
+ this._boxRef?.removeEventListener('wheel', this.onPassiveWheel);
+ this._boxRef = ele;
+ // prevent wheel events from passively propagating up through containers and prevents containers from preventDefault which would block scrolling
+ ele?.addEventListener('wheel', this.onPassiveWheel, { passive: false });
+ })}>
<div className="DIYNodeBox-searchbar">
<input type="text" value={this._inputValue} onKeyDown={action(e => e.key === 'Enter' && this.generateMermaidCode())} onChange={action(e => (this._inputValue = e.target.value))} />
<button type="button" onClick={this.generateMermaidCode}>
@@ -218,7 +234,7 @@ Docs.Prototypes.TemplateMap.set(DocumentType.DIAGRAM, {
_layout_nativeDimEditable: true,
_layout_reflowVertical: true,
_layout_reflowHorizontal: true,
- waitForDoubleClickToClick: 'always',
+ waitForDoubleClickToClick: 'never',
systemIcon: 'BsGlobe',
},
});