Ionic 5 IonInput maxlength not working for real device android and IOS

In Ionic React maxlength not working for IonInput.Working on browser but not in real device(IOS and android).Try Some solution but not working.

  <IonInput
    //name="options"
      type="text"
      value={text}
      onIonChange={(e) =>{ setText(e.detail.value!);console.log(text);}}
      placeholder="OPTION"
      required
      onKeyPress={(e)=>{e.key === "Enter" && e.preventDefault();}}
      enterkeyhint= "enter"
      maxlength={50}
  ></IonInput>