diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-03-27 20:14:37 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-03-27 20:14:37 -0400 |
| commit | 510c26bb46cb8b70cc3fad756396f39a8b7fd687 (patch) | |
| tree | 5a822c51cc2d6a80b194a7f4f5bb52e728089631 /src/client/views/ContextMenu.tsx | |
| parent | 5e53c5953d8550dcf4aa6ad87cd0f68fd835bd14 (diff) | |
addressed contextmenu issues (partially off screen and duplicate entries) and got rid of KeyStore.ActiveFrame
Diffstat (limited to 'src/client/views/ContextMenu.tsx')
| -rw-r--r-- | src/client/views/ContextMenu.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/views/ContextMenu.tsx b/src/client/views/ContextMenu.tsx index 9109b56bb..cfa8ea7b7 100644 --- a/src/client/views/ContextMenu.tsx +++ b/src/client/views/ContextMenu.tsx @@ -49,7 +49,7 @@ export class ContextMenu extends React.Component { //maxX and maxY will change if the UI/font size changes, but will work for any amount //of items added to the menu let maxX = window.innerWidth - 150; - let maxY = window.innerHeight - (this._items.length * 34 + 30); + let maxY = window.innerHeight - ((this._items.length + 1/*for search box*/) * 34 + 30); this._pageX = x > maxX ? maxX : x; this._pageY = y > maxY ? maxY : y; @@ -83,11 +83,8 @@ export class ContextMenu extends React.Component { return ( <div className="contextMenu-cont" style={style} ref={this.ref}> <input className="contextMenu-item" type="text" placeholder="Search . . ." value={this._searchString} onChange={this.onChange}></input> - {this._items.filter(prop => { - return prop.description.toLowerCase().indexOf(this._searchString.toLowerCase()) !== -1; - }).map(prop => { - return <ContextMenuItem {...prop} key={prop.description} /> - })} + {this._items.filter(prop => prop.description.toLowerCase().indexOf(this._searchString.toLowerCase()) !== -1). + map(prop => <ContextMenuItem {...prop} key={prop.description} />)} </div> ) } |
