Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions core/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,8 @@ export abstract class Field<T = any>

let contentWidth = 0;
if (this.textElement_) {
contentWidth = dom.getFastTextWidth(
this.textElement_,
constants!.FIELD_TEXT_FONTSIZE,
constants!.FIELD_TEXT_FONTWEIGHT,
constants!.FIELD_TEXT_FONTFAMILY,
contentWidth = dom.getTextWidth(
this.textElement_
);
totalWidth += contentWidth;
}
Expand Down
14 changes: 4 additions & 10 deletions core/field_dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,8 @@ export class FieldDropdown extends Field<string> {
height / 2 - this.getConstants()!.FIELD_DROPDOWN_SVG_ARROW_SIZE / 2,
);
} else {
arrowWidth = dom.getFastTextWidth(
this.arrow as SVGTSpanElement,
this.getConstants()!.FIELD_TEXT_FONTSIZE,
this.getConstants()!.FIELD_TEXT_FONTWEIGHT,
this.getConstants()!.FIELD_TEXT_FONTFAMILY,
arrowWidth = dom.getTextWidth(
this.arrow as SVGTSpanElement
);
}
this.size_.width = imageWidth + arrowWidth + xPadding * 2;
Expand Down Expand Up @@ -570,11 +567,8 @@ export class FieldDropdown extends Field<string> {
hasBorder ? this.getConstants()!.FIELD_DROPDOWN_BORDER_RECT_HEIGHT : 0,
this.getConstants()!.FIELD_TEXT_HEIGHT,
);
const textWidth = dom.getFastTextWidth(
this.getTextElement(),
this.getConstants()!.FIELD_TEXT_FONTSIZE,
this.getConstants()!.FIELD_TEXT_FONTWEIGHT,
this.getConstants()!.FIELD_TEXT_FONTFAMILY,
const textWidth = dom.getTextWidth(
this.getTextElement()
);
const xPadding = hasBorder
? this.getConstants()!.FIELD_BORDER_RECT_X_PADDING
Expand Down