From 1ab64fef6e861a2958bbd826f086b8aac7d0c359 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 10 Apr 2025 20:42:09 -0400
Subject: fixed dashfieldviews in text boxes to show ellipsis for long lines
 and to hide dropdown menu when field is not editable. fixed pasting from
 pdf's to work and to display the entire text box.

---
 src/client/views/nodes/formattedText/DashFieldView.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/formattedText/DashFieldView.tsx')

diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index bb0efa917..7ea5d1fcf 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -184,7 +184,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
                     getFinfo={this.finfo}
                     setColumnValues={returnFalse}
                     allowCRs
-                    oneLine={!this._expanded}
+                    oneLine={!this._expanded && this._props.editable}
                     finishEdit={this.finishEdit}
                     transform={Transform.Identity}
                     menuTarget={null}
@@ -275,7 +275,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
                     </span>
                 )}
                 {this._props.fieldKey.startsWith('#') || this._hideValue ? null : this.fieldValueContent}
-                {!this.values.length ? null : (
+                {!this.values.length || !this.props.editable ? null : (
                     <select className="dashFieldView-select" tabIndex={-1} defaultValue={this._dashDoc && Field.toKeyValueString(this._dashDoc, this._fieldKey)} onChange={this.selectVal}>
                         <option value="-unset-">-unset-</option>
                         {this.values.map(val => (
@@ -308,6 +308,7 @@ export class DashFieldView {
         this.dom.style.height = node.attrs.height;
         this.dom.style.position = 'relative';
         this.dom.style.display = 'inline-flex';
+        this.dom.style.maxWidth = '100%';
         this.dom.onkeypress = function (e: KeyboardEvent) {
             e.stopPropagation();
         };
-- 
cgit v1.2.3-70-g09d2

