From 321f619e28f24d644ca11a503ba25ba112d5aefc Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 18 Oct 2022 23:01:41 +0200 Subject: [PATCH] fix: Don't warn if field is acually 0 width (#6558) One part of issue 6557. --- core/field.ts | 9 ++++++--- core/utils/parsing.ts | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/field.ts b/core/field.ts index 480a459d2..dc9010633 100644 --- a/core/field.ts +++ b/core/field.ts @@ -797,10 +797,13 @@ export abstract class Field implements IASTNodeLocationSvg, } else if (this.visible_ && this.size_.width === 0) { // If the field is not visible the width will be 0 as well, one of the // problems with the old system. - console.warn( - 'Deprecated use of setting size_.width to 0 to rerender a' + - ' field. Set field.isDirty_ to true instead.'); this.render_(); + // Don't issue a warning if the field is actually zero width. + if (this.size_.width !== 0) { + console.warn( + 'Deprecated use of setting size_.width to 0 to rerender a' + + ' field. Set field.isDirty_ to true instead.'); + } } return this.size_; } diff --git a/core/utils/parsing.ts b/core/utils/parsing.ts index 36452f0d7..3a2fdd611 100644 --- a/core/utils/parsing.ts +++ b/core/utils/parsing.ts @@ -29,8 +29,7 @@ function tokenizeInterpolationInternal( message: string, parseInterpolationTokens: boolean): (string|number)[] { const tokens = []; const chars = message.split(''); - chars.push( // End marker. - ''); + chars.push(''); // End marker. // Parse the message with a finite state machine. // 0 - Base case. // 1 - % found.