Changed editor title input to treat '(Untitled)' as blank

refs https://github.com/TryGhost/Team/issues/707

- the switch to a hard `'(Untitled)'` when you start typing is jarring and pulls you away from writing to want to set a title
- by changing the input to treat '(Untitled)' as a blank value the placeholder continues to be shown so flow isn't broken. Post validation and title display elsewhere in the app is unaffected because we're still setting `'(Untitled')` under the hood, it's only the editor display that changes
This commit is contained in:
Kevin Ansfield 2021-05-27 18:06:35 +01:00
parent 6d66c2cc73
commit a5dd92f1b8
2 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@
@placeholder={{@titlePlaceholder}}
@tabindex="1"
@autoExpand=".gh-koenig-editor"
@value={{readonly @title}}
@value={{readonly this.title}}
@input={{this.updateTitle}}
@focus-out={{optional @onTitleBlur}}
@keyDown={{this.onTitleKeydown}}

View File

@ -7,6 +7,10 @@ export default class GhKoenigEditorComponent extends Component {
koenigEditor = null;
mousedownY = 0;
get title() {
return this.args.title === '(Untitled)' ? '' : this.args.title;
}
@action
registerElement(element) {
this.containerElement = element;