diff options
author | bobzel <zzzman@gmail.com> | 2022-11-08 14:43:47 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-11-08 14:43:47 -0500 |
commit | b8d4b08716791246847d2a647a9df1f37508b87f (patch) | |
tree | 31a3ace00546a20111f66b07a122b15de0c1a946 /src/client/views/nodes/formattedText/DashFieldView.tsx | |
parent | 31a51e9dda07e48c88166bffbc8f1ad7166cd624 (diff) |
making pasting form pdf work again with backlinks. text fixes for equationViews and dashField views -- trying to get docref linkAnchor to work.
Diffstat (limited to 'src/client/views/nodes/formattedText/DashFieldView.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/DashFieldView.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx index afae59733..39b38add2 100644 --- a/src/client/views/nodes/formattedText/DashFieldView.tsx +++ b/src/client/views/nodes/formattedText/DashFieldView.tsx @@ -124,7 +124,7 @@ export class DashFieldViewInternal extends React.Component<IDashFieldViewInterna return ( <span className="dashFieldView-fieldSpan" - contentEditable={this.props.editable} + contentEditable={true} style={{ display: strVal.length < 2 ? 'inline-block' : undefined }} suppressContentEditableWarning={true} defaultValue={strVal} @@ -152,6 +152,10 @@ export class DashFieldViewInternal extends React.Component<IDashFieldViewInterna // we need to handle all key events on the input span or else they will propagate to prosemirror. @action fieldSpanKeyDown = (e: KeyboardEvent, span: HTMLSpanElement) => { + if (e.key === 'c' && (e.ctrlKey || e.metaKey)) { + navigator.clipboard.writeText(window.getSelection()?.toString() || ''); + return; + } if (e.key === 'Enter') { // handle the enter key by "submitting" the current text to Dash's database. this.updateText(span.textContent!, true); |