aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-03-14 01:41:02 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-03-14 01:41:02 -0400
commit0c8a6401bb21a0856785aba80a8feeb66aa98833 (patch)
tree0fe078d9d56ab0063b4bcd53bbdf72416d686a2e /src
parent8aeb0c98eb9291ffbfd70cc9dd6541c8e06e7fcd (diff)
fixed double entry of text boxes.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/PreviewCursor.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/collections/PreviewCursor.tsx b/src/client/views/collections/PreviewCursor.tsx
index ab68fbc46..42b926374 100644
--- a/src/client/views/collections/PreviewCursor.tsx
+++ b/src/client/views/collections/PreviewCursor.tsx
@@ -57,11 +57,13 @@ export class PreviewCursor extends React.Component<PreviewCursorProps> {
@action
onKeyPress = (e: KeyboardEvent) => {
//if not these keys, make a textbox if preview cursor is active!
- if (!e.ctrlKey && !e.altKey) {
+ if (!e.ctrlKey && !e.altKey && !e.defaultPrevented) {
//make textbox and add it to this collection
let [x, y] = this.props.getTransform().transformPoint(this._lastX, this._lastY);
let newBox = Documents.TextDocument({ width: 200, height: 100, x: x, y: y, title: "new" });
this.props.addLiveTextDocuemnt(newBox);
+ e.stopPropagation();
+ e.preventDefault();
}
}