From d6e9556893bb6a99284791f4ce591d098da16e0d Mon Sep 17 00:00:00 2001 From: raclim <43053081+raclim@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:49:18 -0400 Subject: [PATCH 1/2] add check for projectNameInput on project title click --- client/modules/IDE/components/Toolbar.jsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/modules/IDE/components/Toolbar.jsx b/client/modules/IDE/components/Toolbar.jsx index fc6d1d95b6..9658c72223 100644 --- a/client/modules/IDE/components/Toolbar.jsx +++ b/client/modules/IDE/components/Toolbar.jsx @@ -18,6 +18,7 @@ class Toolbar extends React.Component { super(props); this.handleKeyPress = this.handleKeyPress.bind(this); this.handleProjectNameChange = this.handleProjectNameChange.bind(this); + this.handleProjectNameClick = this.handleProjectNameClick.bind(this); this.handleProjectNameSave = this.handleProjectNameSave.bind(this); this.state = { @@ -36,6 +37,17 @@ class Toolbar extends React.Component { this.setState({ projectNameInputValue: event.target.value }); } + handleProjectNameClick() { + if (this.canEditProjectName) { + this.props.showEditProjectName(); + setTimeout(() => { + if (this.projectNameInput) { + this.projectNameInput.focus(); + } + }, 140); + } + } + handleProjectNameSave() { const newProjectName = this.state.projectNameInputValue.trim(); if (newProjectName.length === 0) { @@ -132,12 +144,7 @@ class Toolbar extends React.Component {