aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DashFieldView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-08 14:43:47 -0500
committerbobzel <zzzman@gmail.com>2022-11-08 14:43:47 -0500
commitb8d4b08716791246847d2a647a9df1f37508b87f (patch)
tree31a3ace00546a20111f66b07a122b15de0c1a946 /src/client/views/nodes/formattedText/DashFieldView.tsx
parent31a51e9dda07e48c88166bffbc8f1ad7166cd624 (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.tsx6
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);