preventDefault not working on ionic on <input type=“number”>

try pattern attribute to achieve this. it is very easy

pattern="([0-9]{8})"

pattern Attribute in ion-input