diff options
| author | bobzel <zzzman@gmail.com> | 2025-02-11 16:03:29 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-02-11 16:03:29 -0500 |
| commit | 3e531aa898492cb05e25081f422bb59adab72e8e (patch) | |
| tree | 29f23fa2619cf4d9aca71f455a0e5724c52bd57a /src/client/views/nodes/DiagramBox.tsx | |
| parent | 1ef0a2d7835c9dfa1ec9fc298562f3a052b3e817 (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.tsx | 20 |
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', }, }); |
