fix advanced editor in description (#7372)

This commit is contained in:
jessopb 2021-12-29 15:58:55 -05:00 committed by GitHub
parent 24c516acb0
commit ca15faef02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,11 +18,17 @@ function PublishDescription(props: Props) {
setAdvancedEditor(!advancedEditor);
}
function handleCommentChange(event) {
let descriptionValue = advancedEditor ? event : event.target.value;
updatePublishForm({ description: descriptionValue });
}
return (
<Card
actions={
<FormField
type={'textarea'}
type={advancedEditor ? 'markdown' : 'textarea'}
name="content_description"
label={__('Description')}
placeholder={__(
@ -30,7 +36,7 @@ function PublishDescription(props: Props) {
)}
value={description}
disabled={disabled}
onChange={(value) => updatePublishForm({ description: advancedEditor ? value : value.target.value })}
onChange={handleCommentChange}
quickActionLabel={advancedEditor ? __('Simple Editor') : __('Advanced Editor')}
quickActionHandler={toggleMarkdown}
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}