diff options
author | bob <bcz@cs.brown.edu> | 2019-05-30 10:51:00 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-05-30 10:51:00 -0400 |
commit | 37e16bb59a38c000ba80312a0661e1f54c93f3c6 (patch) | |
tree | 0a9669b43a43478be1ea0e5d9c0c421d3c9a6533 /src/client/views/ContextMenu.tsx | |
parent | 83edfcd06b659839f161121728de02aca91d4af8 (diff) |
cleaned up event handling for documentviews. fixed context menu closing.
Diffstat (limited to 'src/client/views/ContextMenu.tsx')
-rw-r--r-- | src/client/views/ContextMenu.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/ContextMenu.tsx b/src/client/views/ContextMenu.tsx index 542d259d6..da374455e 100644 --- a/src/client/views/ContextMenu.tsx +++ b/src/client/views/ContextMenu.tsx @@ -81,6 +81,11 @@ export class ContextMenu extends React.Component { return false; } + @action + closeMenu = () => { + this.clearItems(); + } + render() { let style = this._yRelativeToTop ? { left: this._pageX, top: this._pageY, display: this._display } : { left: this._pageX, bottom: this._pageY, display: this._display }; @@ -95,7 +100,7 @@ export class ContextMenu extends React.Component { <input className="contextMenu-item contextMenu-description" type="text" placeholder="Search . . ." value={this._searchString} onChange={this.onChange} /> </span> {this._items.filter(prop => prop.description.toLowerCase().indexOf(this._searchString.toLowerCase()) !== -1). - map(prop => <ContextMenuItem {...prop} key={prop.description} />)} + map(prop => <ContextMenuItem {...prop} key={prop.description} closeMenu={this.closeMenu} />)} </div> ); } |