diff --git a/shared/js/ui/tree/RendererClient.tsx b/shared/js/ui/tree/RendererClient.tsx index 622d6d6b..281b0ac9 100644 --- a/shared/js/ui/tree/RendererClient.tsx +++ b/shared/js/ui/tree/RendererClient.tsx @@ -154,7 +154,7 @@ class ClientNameEdit extends React.Component { ref={this.refDiv} dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(this.props.initialName)}} onBlur={() => this.onBlur()} - onKeyPress={e => this.onKeyPress(e)} + onKeyDown={e => this.onKeyDown(e)} /> } @@ -162,7 +162,7 @@ class ClientNameEdit extends React.Component { this.props.editFinished(this.refDiv.current.textContent); } - private onKeyPress(event: React.KeyboardEvent) { + private onKeyDown(event: React.KeyboardEvent) { if (event.key === "Enter") { event.preventDefault(); this.onBlur();