Skip to content

Commit

Permalink
fix: Don't warn if field is acually 0 width (#6558)
Browse files Browse the repository at this point in the history
One part of issue 6557.
  • Loading branch information
NeilFraser authored Oct 18, 2022
1 parent df660af commit 321f619
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions core/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
Expand Down
3 changes: 1 addition & 2 deletions core/utils/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 321f619

Please sign in to comment.