Auto-select username input field when changing name. (#1754)

Co-authored-by: Le Fractal <17422-fractal@users.noreply.framagit.org>
This commit is contained in:
le-fractal
2022-03-06 07:20:23 +01:00
committed by GitHub
parent 9125083f37
commit c86a07122b

View File

@@ -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) { render(props, state) {
const { username, isModerator } = props; const { username, isModerator } = props;
const { displayForm } = state; const { displayForm } = state;