0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

🐛 Fixed code card not correctly saving language when changing

closes https://github.com/TryGhost/Team/issues/1662

- the on-blur action for the language input was modifying the language property in the payload object directly which meant that the mobiledoc `save` call was missing and all the associated editor behaviour for serializing and saving the update was lost
- switched to modern action syntax and a proper action on the backing component so we're saving the change correctly
This commit is contained in:
Kevin Ansfield 2022-07-14 17:29:52 +01:00
parent 587ae505f0
commit aab02f0f4c
2 changed files with 6 additions and 1 deletions

View file

@ -31,7 +31,7 @@
<input
type="text"
value={{readonly this.payload.language}}
onblur={{action (mut this.payload.language) value="target.value"}}
{{on "blur" this.updateLanguage}}
placeholder="Language..."
class="absolute w-20 pa1 ba b--lightgrey br2 f8 tracked-2 fw4 z-999 outline-0 anim-normal"
style={{this.languageInputStyle}}

View file

@ -117,6 +117,11 @@ export default class KoenigCardCode extends Component {
this._updatePayloadAttr('caption', caption);
}
@action
updateLanguage(event) {
this._updatePayloadAttr('language', event.target.value);
}
@action
enterEditMode() {
this._addMousemoveHandler();