Skip to content

Commit b571ded

Browse files
authored
Merge branch 'develop' into fix/document-theme
2 parents e2c28a0 + edae248 commit b571ded

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

client/common/Button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Button.propTypes = {
257257
* The visible part of the button, telling the user what
258258
* the action is
259259
*/
260-
children: PropTypes.element,
260+
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
261261
/**
262262
If the button can be activated or not
263263
*/

client/modules/IDE/components/Toolbar.jsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Toolbar extends React.Component {
1818
super(props);
1919
this.handleKeyPress = this.handleKeyPress.bind(this);
2020
this.handleProjectNameChange = this.handleProjectNameChange.bind(this);
21+
this.handleProjectNameClick = this.handleProjectNameClick.bind(this);
2122
this.handleProjectNameSave = this.handleProjectNameSave.bind(this);
2223

2324
this.state = {
@@ -36,6 +37,17 @@ class Toolbar extends React.Component {
3637
this.setState({ projectNameInputValue: event.target.value });
3738
}
3839

40+
handleProjectNameClick() {
41+
if (this.canEditProjectName) {
42+
this.props.showEditProjectName();
43+
setTimeout(() => {
44+
if (this.projectNameInput) {
45+
this.projectNameInput.focus();
46+
}
47+
}, 140);
48+
}
49+
}
50+
3951
handleProjectNameSave() {
4052
const newProjectName = this.state.projectNameInputValue.trim();
4153
if (newProjectName.length === 0) {
@@ -132,12 +144,7 @@ class Toolbar extends React.Component {
132144
<div className={nameContainerClass}>
133145
<button
134146
className="toolbar__project-name"
135-
onClick={() => {
136-
if (canEditProjectName) {
137-
this.props.showEditProjectName();
138-
setTimeout(() => this.projectNameInput.focus(), 140);
139-
}
140-
}}
147+
onClick={this.handleProjectNameClick}
141148
disabled={!canEditProjectName}
142149
aria-label={this.props.t('Toolbar.EditSketchARIA')}
143150
>

0 commit comments

Comments
 (0)