From c86a07122bcb58eb16f142b440bd7547ed4381d3 Mon Sep 17 00:00:00 2001 From: le-fractal <8377141+le-fractal@users.noreply.github.com> Date: Sun, 6 Mar 2022 07:20:23 +0100 Subject: [PATCH] Auto-select username input field when changing name. (#1754) Co-authored-by: Le Fractal <17422-fractal@users.noreply.framagit.org> --- webroot/js/components/chat/username.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webroot/js/components/chat/username.js b/webroot/js/components/chat/username.js index fb4be113e..c95e3ea56 100644 --- a/webroot/js/components/chat/username.js +++ b/webroot/js/components/chat/username.js @@ -79,6 +79,12 @@ export default class UsernameForm extends Component { } } + componentDidUpdate({ }, { displayForm }) { + if (this.state.displayForm && !displayForm ) { + document.getElementById('username-change-input').select(); + } + } + render(props, state) { const { username, isModerator } = props; const { displayForm } = state;