【发布时间】:2019-07-10 14:50:08
【问题描述】:
尝试使用关闭图标按钮进行输入,<input type=search> 但我需要更多样式,所以我决定自己制作,但问题是输入的位置和标签在想要清除输入时也略有移动。
form.component.html
<div class="flex-center ">
<input class="input" [(ngModel)]="value">
<button *ngIf="value" class="button-close" (click)="value=''">
</button>
<label class="desc">description</label>
</div>
form.component.css
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.desc {
padding-left: 16px;
}
.button-close {
margin-left: -5%;
}
这是我迄今为止尝试过的,clereable input demo。需要建议如何解决这个问题,
【问题讨论】:
标签: css angular angular-ng-if bulma