Commit 3a0f2ff5 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '201761-design-discussion-note-preview-is-broken' into 'master'

Resolve "Design discussion note preview is broken"

See merge request gitlab-org/gitlab!24288
parents 4b5774a7 97094154
......@@ -79,6 +79,12 @@ export default {
required: false,
default: false,
},
// This prop is used as a fallback in case if textarea.elm is undefined
textareaValue: {
type: String,
required: false,
default: '',
},
},
data() {
return {
......@@ -183,7 +189,7 @@ export default {
Can't use `$refs` as the component is technically in the parent component
so we access the VNode & then get the element
*/
const text = this.$slots.textarea[0].elm.value;
const text = this.$slots.textarea[0]?.elm?.value || this.textareaValue;
if (text) {
this.markdownPreviewLoading = true;
......
---
title: Resolve Design discussion note preview is broken
merge_request: 24288
author:
type: fixed
......@@ -53,6 +53,7 @@ export default {
:markdown-preview-path="markdownPreviewPath"
:can-attach-file="false"
:enable-autocomplete="false"
:textarea-value="value"
markdown-docs-path="/help/user/markdown"
class="bordered-box"
>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment