From dacd518b633e32113d7c5879cc8195d01cb8b6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 7 Oct 2020 08:44:21 +0200 Subject: [PATCH] Fix placeholder display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/components/Properties/PropertyText.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/Properties/PropertyText.vue b/src/components/Properties/PropertyText.vue index f1273a05e..2a6efe2cb 100644 --- a/src/components/Properties/PropertyText.vue +++ b/src/components/Properties/PropertyText.vue @@ -72,7 +72,7 @@ :class="{'property__value--with-ext': haveExtHandler}" type="text" class="property__value" - :placeholder="localType.placeholder" + :placeholder="placeholder" @input="updateValue"> @@ -158,6 +158,18 @@ export default { haveExtHandler() { return this.externalHandler.trim() !== '' && this.localValue && this.localValue.length > 0 }, + + /** + * Return the selected type placeholder if any + * or the propModel default placeholder + * @returns {string} + */ + placeholder() { + if (this.localType?.placeholder) { + return this.localType.placeholder + } + return this.propModel.placeholder + }, }, mounted() {