16

We're using HTML5 form validation without overwriting the default system UI for the validation error messages. This is working fine everywhere but on iOS Safari, where the validation messages are not aligned properly inside the bubble popup. We have tested this on two completely separate devices and with different forms. Even a minimal form with no CSS has the same result:

https://jsfiddle.net/GinSan/48hnrf92/1/

<form>
  <label for="test">Test field</label>
  <input required id="test" name="test" type="text">
  <button type="submit">Submit</button>
</form>

This is what the validation message looks like on the iOS devices we tested:

validation message in English on iPhone

validation message in German on iPad

The validation message is aligned to the top instead of centered, even though this is a system UI element. Is this a known problem? Is there anything that can be done about it, except reporting it to apple and waiting for a fix, or replacing the system validation messages?

My Safari version was Safari / iOS 13.3.1, but after upgrading to 13.5 it is still an issue.

TylerH
  • 20,799
  • 66
  • 75
  • 101
MoritzLost
  • 2,611
  • 2
  • 18
  • 32
  • 2
    I'm also experiencing this. Looks like a webkit issue. since all browsers on iOS must use the webkit engine, changes are you will experience this on Chrome as well. See 2.5.6: https://developer.apple.com/app-store/review/guidelines/#software-requirements – Ali Zahid May 29 '20 at 01:58
  • 1
    Fwiw this seems to be resolved on iOS 14 and iOS 15 – D-Money Sep 23 '21 at 14:20

1 Answers1

-1

Add a class to your form

and with CSS add this

display: flex;
align-items: center;
Vaxind
  • 96
  • 1
  • 1
  • 7