From b47b1d8af82575675d34b7e504208cd0f24cb7b3 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Fri, 20 Dec 2019 22:17:51 +1100 Subject: [PATCH] FIX: label helpers on sign up form are not hidden (#8603) This commit https://github.com/discourse/discourse/commit/fe9293b8b554ab79636faa61a4756d5ff514a233 created a regression. The problem is that dom changed a little bit. Before it was ```
``` And after we got ```
``` That small space may look like not important change. However, now helpers are hitting that CSS rule: ``` .login-form { .tip { &:not(:empty) + td { display: none; } } ``` To fix it, we should render template only if there is a reason - like it was before ``` if (reason) { buffer.push(iconHTML(this.good ? "check" : "times") + " " + reason); } ``` * FIX: remove rerenderTriggers --- app/assets/javascripts/discourse/components/input-tip.js.es6 | 1 - .../javascripts/discourse/templates/components/input-tip.hbs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/components/input-tip.js.es6 b/app/assets/javascripts/discourse/components/input-tip.js.es6 index 1a12d8ebc0e..b48a5df8cf7 100644 --- a/app/assets/javascripts/discourse/components/input-tip.js.es6 +++ b/app/assets/javascripts/discourse/components/input-tip.js.es6 @@ -4,7 +4,6 @@ import { iconHTML } from "discourse-common/lib/icon-library"; export default Component.extend({ classNameBindings: [":tip", "good", "bad"], - rerenderTriggers: ["validation"], tipIcon: null, tipReason: null, diff --git a/app/assets/javascripts/discourse/templates/components/input-tip.hbs b/app/assets/javascripts/discourse/templates/components/input-tip.hbs index ade54357b51..60c2336dfcb 100644 --- a/app/assets/javascripts/discourse/templates/components/input-tip.hbs +++ b/app/assets/javascripts/discourse/templates/components/input-tip.hbs @@ -1 +1,3 @@ -{{tipIcon}} {{tipReason}} +{{#if tipReason}} + {{tipIcon}} {{tipReason}} +{{/if}}