diff options
| author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-03-17 21:34:30 -0400 |
|---|---|---|
| committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-03-17 21:34:30 -0400 |
| commit | 36a8067ff4e8d081c8336b016fd9f586b40f65f6 (patch) | |
| tree | 7cd4a1278a55962fa8f1eff172762cab9eeb18dc /src/client/views/collections/PreviewCursor.tsx | |
| parent | 54048114bca3a01a6d287112d975edd00a4e398a (diff) | |
| parent | 8433cc2b1c4d838930c3812d140678011b06e728 (diff) | |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into DocContents
Diffstat (limited to 'src/client/views/collections/PreviewCursor.tsx')
| -rw-r--r-- | src/client/views/collections/PreviewCursor.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/collections/PreviewCursor.tsx b/src/client/views/collections/PreviewCursor.tsx index ab68fbc46..a1411250a 100644 --- a/src/client/views/collections/PreviewCursor.tsx +++ b/src/client/views/collections/PreviewCursor.tsx @@ -16,7 +16,7 @@ import { CollectionFreeFormView } from "./CollectionFreeFormView"; export interface PreviewCursorProps { getTransform: () => Transform; container: CollectionFreeFormView; - addLiveTextDocuemnt: (doc: Document) => void; + addLiveTextDocument: (doc: Document) => void; } @observer @@ -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); + this.props.addLiveTextDocument(newBox); + e.stopPropagation(); + e.preventDefault(); } } |
