我有一个奇怪的行为,离子文本区autoGrow="true“是在ionic 4.4中引入的,这是第一次正确地制作autoGrow。第二次文本区域小于1行。我们不能查看文本。
第一次:

第二次:

我像这样打开模式
displayModal(data) {
this.modalCtrl.create({
component: EventDetailModalComponent, componentProps: {
event: data.appointmentData,
timeFormat: this.timeFormat,
dateFormat: this.dateFormat
}
}).then(modalElement => {
modalElement.present();
}); }然后像这样闭合:
onCancel() { this.modalCtrl.dismiss(); }视图包含:
<ion-item lines="none">
<ion-label position="floating">{{'DESCRIPTION' | translate }}</ion-label>
<ion-textarea readonly disabled autoGrow="true" class="ion-text-justify" value="{{ description }}" ></ion-textarea>
</ion-item>对于信息,文本由程序手动插入value="x“中,而不是由用户输入。
我运行的是ionic (“@I native/core”:"^5.11.0")和Angular (8.2)的最新版本。
同样的问题在最新版本的Chrome,Safari和FireFox上进行了测试。
发布于 2021-01-06 20:46:56
您可以在ion-textarea的textarea子元素上设置min-height,如下所示
::ng-deep textarea {
min-height: 45px;
}
发布于 2021-05-07 05:15:42
nd::deep已弃用
https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep
在global.scss中添加这段代码对我很有效
ion-textarea {
min-height: 40px;
textarea {
min-height: 40px;
}
}https://stackoverflow.com/questions/57336796
复制相似问题