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 { ...@@ -79,6 +79,12 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
// This prop is used as a fallback in case if textarea.elm is undefined
textareaValue: {
type: String,
required: false,
default: '',
},
}, },
data() { data() {
return { return {
...@@ -183,7 +189,7 @@ export default { ...@@ -183,7 +189,7 @@ export default {
Can't use `$refs` as the component is technically in the parent component Can't use `$refs` as the component is technically in the parent component
so we access the VNode & then get the element 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) { if (text) {
this.markdownPreviewLoading = true; this.markdownPreviewLoading = true;
......
---
title: Resolve Design discussion note preview is broken
merge_request: 24288
author:
type: fixed
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
:markdown-preview-path="markdownPreviewPath" :markdown-preview-path="markdownPreviewPath"
:can-attach-file="false" :can-attach-file="false"
:enable-autocomplete="false" :enable-autocomplete="false"
:textarea-value="value"
markdown-docs-path="/help/user/markdown" markdown-docs-path="/help/user/markdown"
class="bordered-box" 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