Ionic 4 AlertController Input type text maxLength

I need to add maxLength to my AlertController input field, which has type text, however type text has no default property [max] or [min] so I have used this approach to achieve this

placeholder: ‘Name’,
name: ‘groupName’,
type: ‘text’,
id: ‘maxLength6’,

await alert.present().
then(maxLength6 => { document.getElementById(‘maxLength6’).setAttribute(‘maxlength’, ‘6’); });

This works fine on simulator Androis/iOS and in browser, but on real devices maxLength is not applied.

Do you have any alternative solution for this issue?

Any help would be appreciated.


You could always just use ModalController instead, in which case you get total control over the presented component.