Skip to content

Commit 9505c7c

Browse files
fix(module:mention): page not loading entirely (#8146)
* fix(module:mention): page not loading entirely * fix(module:mention): page not loading entirely
1 parent 50f6700 commit 9505c7c

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

components/mention/demo/form.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@ import { NzMentionComponent } from 'ng-zorro-antd/mention';
2525
</nz-form-item>
2626
<nz-form-item nz-row style="margin-bottom:8px;">
2727
<nz-form-control [nzSpan]="14" [nzOffset]="6">
28-
<button type="button" nz-button nzType="primary" (click)="submitForm()">Submit</button>
29-
&nbsp;&nbsp;&nbsp;
30-
<button type="button" nz-button (click)="resetForm()">Reset</button>
28+
<div class="cta-wrapper">
29+
<button type="button" nz-button nzType="primary" (click)="submitForm()">Submit</button>
30+
<button type="button" nz-button (click)="resetForm()">Reset</button>
31+
</div>
3132
</nz-form-control>
3233
</nz-form-item>
3334
</form>
34-
`
35+
`,
36+
styles: [
37+
`
38+
.cta-wrapper {
39+
display: flex;
40+
gap: 1rem;
41+
}
42+
`
43+
]
3544
})
3645
export class NzDemoMentionFormComponent {
37-
suggestions = ['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご'];
46+
suggestions = ['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご', 'ParsaArvaneh'];
3847
validateForm: FormGroup<{ mention: FormControl<string | null> }>;
3948
@ViewChild('mentions', { static: true }) mentionChild!: NzMentionComponent;
4049

@@ -51,7 +60,7 @@ export class NzDemoMentionFormComponent {
5160
mentionValidator: ValidatorFn = (control: AbstractControl) => {
5261
if (!control.value) {
5362
return { required: true };
54-
} else if (this.mentionChild.getMentions().length < 2) {
63+
} else if (this.mentionChild?.getMentions().length < 2) {
5564
return { confirm: true, error: true };
5665
}
5766
return {};

0 commit comments

Comments
 (0)