Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
feat(Editor): Auto focus & format theme name when contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Mar 7, 2020
1 parent 743a66d commit c060c6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/demo/editor/contributeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ContributeForm extends React.PureComponent<Props, State> {

onNameChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
e.preventDefault()
this.setProjectName(e.currentTarget.value)
this.setProjectName(e.currentTarget.value.replace(/\s/g, '-'))
}

onRandomizeName = (e: React.MouseEvent<HTMLButtonElement>): void => {
Expand Down Expand Up @@ -75,6 +75,7 @@ export class ContributeForm extends React.PureComponent<Props, State> {

<div className="labelWrapper">
<input
autoFocus={true}
value={this.state.projectName}
onChange={this.onNameChange}
/>
Expand Down

0 comments on commit c060c6e

Please sign in to comment.