Skip to content

Commit

Permalink
fix(legacy): primitive-textfield incorrect placeholder raisable calcu…
Browse files Browse the repository at this point in the history
…lation
  • Loading branch information
dequubi authored and splincode committed Dec 24, 2024
1 parent 3d2e83c commit b417e48
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ export const TUI_ICON_START_PADDINGS: Record<TuiSizeL | TuiSizeS, number> = {
'[class._autofilled]': 'autofilled',
'[style.--border-start.rem]': 'borderStart',
'[style.--border-end.rem]': 'borderEnd',
'[class._label-outside]':
'options.appearance() === "table" || controller.labelOutside',
'[class._label-outside]': 'labelOutside',
'(focusin)': 'onFocused(true)',
'(focusout)': 'onFocused(false)',
'(transitionstart.capture)': 'transitionStartHandler($event)',
Expand Down Expand Up @@ -146,6 +145,12 @@ export class TuiPrimitiveTextfieldComponent
this.updateValue(value);
}

protected get labelOutside(): boolean {
const {size, labelOutside} = this.controller;

return this.appearance === 'table' || size === 's' || labelOutside;
}

protected get size(): TuiSizeL | TuiSizeS {
return this.controller.size;
}
Expand Down Expand Up @@ -303,7 +308,7 @@ export class TuiPrimitiveTextfieldComponent
}

private get placeholderRaisable(): boolean {
return this.size !== 's' && !this.controller.labelOutside;
return this.size !== 's' && !this.labelOutside;
}

private updateAutofilled(autofilled: boolean): void {
Expand Down

0 comments on commit b417e48

Please sign in to comment.