From 022dd5760619b26be6b55c87127fb2f73ede1f82 Mon Sep 17 00:00:00 2001 From: Sential Date: Thu, 26 Jul 2018 01:07:47 +0200 Subject: [PATCH] Select all on input focus in bookmarks Former-commit-id: 99d8f8789f1851c5bd2299428df1f7d21b10654f [formerly 99d8f8789f1851c5bd2299428df1f7d21b10654f [formerly 7bdb1410696e731fbd1c513c6aba5fa0b94fa57c]] Former-commit-id: 7fda8a1d41241c4aa5344805116f2985876fe278 Former-commit-id: 6a3db893a81a6b33b6c5e32ca2967734dffc48cd --- src/menu/bookmarks/components/Item/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/menu/bookmarks/components/Item/index.tsx b/src/menu/bookmarks/components/Item/index.tsx index b46680536..eb545778c 100644 --- a/src/menu/bookmarks/components/Item/index.tsx +++ b/src/menu/bookmarks/components/Item/index.tsx @@ -124,7 +124,9 @@ export default class Item extends React.Component { } }; - public onEditClick = (e: React.MouseEvent) => {}; + public onInputFocus = (e: React.FocusEvent) => { + e.currentTarget.select(); + }; public render() { const { data } = this.props; @@ -155,6 +157,7 @@ export default class Item extends React.Component { innerRef={r => (this.input = r)} visible={inputVisible} onClick={this.onInputMouseEvent} + onFocus={this.onInputFocus} onMouseDown={this.onInputMouseEvent} onKeyPress={this.onInputKeyPress} placeholder="Name"