8000 fix(thy-custom-select): fix display error when labelText is empty string · atinc/ngx-tethys@821e6f0 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 821e6f0

Browse files
committed
fix(thy-custom-select): fix display error when labelText is empty string
1 parent 1d02f04 commit 821e6f0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

demo/src/app/components/+select/select-section.component.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,27 @@ <h2>多选</h2>
3333
</div>
3434
</section>
3535

36+
<section>
37+
<div class="header">
38+
<h2>thyShowOptionCustom thyLabelText为空的情况</h2>
39+
</div>
40+
<div class="body">
41+
<div class="demo-select">
42+
<thy-custom-select [(ngModel)]="errorSelectedItem" thyPlaceHolder="" thySize="md" thyEmptyStateText="无匹配结果">
43+
<thy-option
44+
*ngFor="let option of optionData"
45+
[thyValue]="option"
46+
[thyDisabled]="option.name === 'money'"
47+
[thyLabelText]="''"
48+
thyShowOptionCustom="true"
49+
>
50+
{{ option.display_name }}
51+
</thy-option>
52+
</thy-custom-select>
53+
</div>
54+
</div>
55+
</section>
56+
3657
<section>
3758
<div class="header">
3859
<h2>自定义 select</h2>

demo/src/app/components/+select/select-section.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export class DemoSelectSectionComponent implements OnInit {
4242

4343
selectedItem = this.optionData[0];
4444

45+
errorSelectedItem = {};
46+
4547
public apiParameters = [
4648
{
4749
property: 'thySize',

src/select/custom-select.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ng-container *ngSwitchDefault [ngSwitch]="thyMode">
2020
<ng-container *ngSwitchCase="'multiple'">
2121
<span
22-
class="mr-1"
22+
class="d-inline-block mr-1"
2323
*ngFor="let item of selected; index as i"
2424
thyLabel="default"
2525
thyAfterIcon="wtf-times"
@@ -29,7 +29,7 @@
2929
</span>
3030
</ng-container>
3131
<ng-container *ngSwitchDefault>
32-
<span>{{ firstSelected.thyLabelText }}</span>
32+
<span class="d-inline-block">{{ firstSelected.thyLabelText }}</span>
3333
</ng-container>
3434
</ng-container>
3535
<a

0 commit comments

Comments
 (0)
0