diff options
| author | bob <bcz@cs.brown.edu> | 2019-07-30 09:41:08 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-07-30 09:41:08 -0400 |
| commit | fe2ae4e235a12198a530672d4db3fdcd167c6e65 (patch) | |
| tree | f44fbc2b53eba3eadc51b851600b706c0e451d5a /src/client/views/MetadataEntryMenu.tsx | |
| parent | 5591060e868053c8839fcc1de1ae77d4dac361ac (diff) | |
| parent | e041988b84553797699a5a232e26e72252460e01 (diff) | |
Merge branch 'master' into youtube-api-muhammed
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; |
