fix comment replies when turning off advanced mode

This commit is contained in:
Sean Yesmunt 2020-06-03 11:37:57 -04:00
parent 1cae7a6038
commit 48a707f0db

View file

@ -56,7 +56,14 @@ export function CommentCreate(props: Props) {
}, [channel, topChannel]); }, [channel, topChannel]);
function handleCommentChange(event) { function handleCommentChange(event) {
setCommentValue(advancedEditor ? event : event.target.value); let commentValue;
if (isReply) {
commentValue = event.target.value;
} else {
commentValue = advancedEditor ? event : event.target.value;
}
setCommentValue(commentValue);
} }
function handleChannelChange(channel) { function handleChannelChange(channel) {
@ -106,7 +113,7 @@ export function CommentCreate(props: Props) {
name={isReply ? 'content_reply' : 'content_description'} name={isReply ? 'content_reply' : 'content_description'}
label={isReply ? __('Replying as %reply_channel%', { reply_channel: channel }) : __('Comment')} label={isReply ? __('Replying as %reply_channel%', { reply_channel: channel }) : __('Comment')}
quickActionLabel={isReply ? undefined : advancedEditor ? __('Simple Editor') : __('Advanced Editor')} quickActionLabel={isReply ? undefined : advancedEditor ? __('Simple Editor') : __('Advanced Editor')}
quickActionHandler={isReply ? toggleEditorMode : undefined} quickActionHandler={isReply ? undefined : toggleEditorMode}
onFocus={onTextareaFocus} onFocus={onTextareaFocus}
placeholder={__('Say something about this...')} placeholder={__('Say something about this...')}
value={commentValue} value={commentValue}