From 88a0824944720b6edaaef56376713541b9a02118 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 4 Feb 2020 12:09:00 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/vue_shared/components/markdown/field.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/assets/javascripts/vue_shared') diff --git a/app/assets/javascripts/vue_shared/components/markdown/field.vue b/app/assets/javascripts/vue_shared/components/markdown/field.vue index 4f5f3ee5cf9..e30876813c2 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/field.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/field.vue @@ -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; -- cgit v1.2.3