diff options
| author | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-29 19:45:25 -0400 |
|---|---|---|
| committer | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-29 19:45:25 -0400 |
| commit | 41583609724911182f2c16b06e61bee6a779bb34 (patch) | |
| tree | ff32273d40d832edd24385b4ea7a7b95ef311f21 /src/client/views/MetadataEntryMenu.tsx | |
| parent | 215b73fbcfe0d6f205668e1bb7c755228e858ac9 (diff) | |
| parent | d7af2cae3ec66ca9a8c9abbc0a221ee1dbb6d101 (diff) | |
Merge master, quick opacity changes
Diffstat (limited to 'src/client/views/MetadataEntryMenu.tsx')
| -rw-r--r-- | src/client/views/MetadataEntryMenu.tsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/views/MetadataEntryMenu.tsx b/src/client/views/MetadataEntryMenu.tsx index bd5a307b3..36c240dd8 100644 --- a/src/client/views/MetadataEntryMenu.tsx +++ b/src/client/views/MetadataEntryMenu.tsx @@ -5,6 +5,7 @@ import { observable, action, runInAction, trace } from 'mobx'; import { KeyValueBox } from './nodes/KeyValueBox'; import { Doc, Field } from '../../new_fields/Doc'; import * as Autosuggest from 'react-autosuggest'; +import { undoBatch } from '../util/UndoManager'; export type DocLike = Doc | Doc[] | Promise<Doc> | Promise<Doc[]>; export interface MetadataEntryProps { @@ -74,8 +75,11 @@ export class MetadataEntryMenu extends React.Component<MetadataEntryProps>{ this.userModified = e.target.value.trim() !== ""; } + @undoBatch + @action onValueKeyDown = async (e: React.KeyboardEvent) => { if (e.key === "Enter") { + e.stopPropagation(); const script = KeyValueBox.CompileKVPScript(this._currentValue); if (!script) return; let doc = this.props.docs; |
