import React from 'react'; import { animation, contextMenu, Item, Menu } from 'react-contexify'; import { DefaultTheme } from 'styled-components'; import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; interface Props { searchString: string; onChange: any; handleNavigation?: any; placeholder: string; } export class SessionSearchInput extends React.Component { public constructor(props: Props) { super(props); this.handleKeyDown = this.handleKeyDown.bind(this); } public render() { const { searchString } = this.props; const triggerId = 'session-search-input-context'; return ( <>
{ contextMenu.show({ id: triggerId, event: e, }); }} > this.props.onChange(e.target.value)} onKeyDown={this.handleKeyDown} placeholder={this.props.placeholder} />
document.execCommand('undo')}>{window.i18n('editMenuUndo')} document.execCommand('redo')}>{window.i18n('editMenuRedo')}
document.execCommand('cut')}>{window.i18n('editMenuCut')} document.execCommand('copy')}>{window.i18n('editMenuCopy')} document.execCommand('paste')}>{window.i18n('editMenuPaste')} document.execCommand('selectAll')}> {window.i18n('editMenuSelectAll')}
); } public handleKeyDown(e: any) { if (e.keyCode === 38 || e.keyCode === 40 || e.key === 'Enter') { // Up or Bottom arrow pressed if (this.props.handleNavigation) { e.stopPropagation(); this.props.handleNavigation(e); } } } }