Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(legacy): wrong prefix placement in table context #10026

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
<tbody tuiTbody>
<tr *ngFor="let item of data">
<td tuiTd>{{ item.name }}</td>
<td tuiTd>{{ item.balance }}</td>
<td tuiTd>
<tui-input
tuiTextfieldPrefix="$"
[(ngModel)]="item.balance"
>
Value
</tui-input>
</td>
<td
tuiTd
[style.white-space]="'nowrap'"
Expand Down
12 changes: 10 additions & 2 deletions projects/demo/src/modules/components/table/examples/8/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import {NgForOf} from '@angular/common';
import {Component} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiTable} from '@taiga-ui/addon-table';
import {TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
imports: [NgForOf, TuiTable],
imports: [
FormsModule,
NgForOf,
TuiInputModule,
TuiTable,
TuiTextfieldControllerModule,
],
templateUrl: './index.html',
encapsulation,
changeDetection,
Expand All @@ -25,5 +33,5 @@ export default class Example {
description:
'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.',
},
] as const;
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export class TuiPrimitiveTextfieldComponent
return this.nativeFocusableElement?.id || '';
}

protected get isContextTable(): boolean {
return this.appearance === 'table';
}

@tuiPure
protected getIndent$(element: HTMLElement): Observable<number> {
return fromEvent(element, 'scroll').pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
<div class="t-wrapper">
<label
*ngIf="hasPlaceholder"
*ngIf="hasPlaceholder && !isContextTable"
splincode marked this conversation as resolved.
Show resolved Hide resolved
automation-id="tui-primitive-textfield__placeholder"
class="t-placeholder"
[class.t-placeholder_raised]="placeholderRaised"
Expand Down
Loading