Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
Select all on input focus in bookmarks
Browse files Browse the repository at this point in the history
Former-commit-id: 99d8f87 [formerly 99d8f87 [formerly 7bdb141]]
Former-commit-id: 7fda8a1d41241c4aa5344805116f2985876fe278
Former-commit-id: 6a3db89
  • Loading branch information
sentialx committed Jul 25, 2018
1 parent b89f8bf commit 022dd57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/menu/bookmarks/components/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export default class Item extends React.Component<IProps, IState> {
}
};

public onEditClick = (e: React.MouseEvent<HTMLDivElement>) => {};
public onInputFocus = (e: React.FocusEvent<HTMLInputElement>) => {
e.currentTarget.select();
};

public render() {
const { data } = this.props;
Expand Down Expand Up @@ -155,6 +157,7 @@ export default class Item extends React.Component<IProps, IState> {
innerRef={r => (this.input = r)}
visible={inputVisible}
onClick={this.onInputMouseEvent}
onFocus={this.onInputFocus}
onMouseDown={this.onInputMouseEvent}
onKeyPress={this.onInputKeyPress}
placeholder="Name"
Expand Down

0 comments on commit 022dd57

Please sign in to comment.