IOS devices issues with HTML form input (type = text)

后端 未结 3 1818
无人共我
无人共我 2020-12-09 03:37

So I have an HTML login form with two fields: Email and Password. These can be filled easily on any device\'s browser other than IOS devices(iPhone,iPad). On IOS fields can

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 04:18

    Found the issue, it's a stylesheet reset I found online to help with touch devices behaviour for when the user touch/ hold an element and I copied it across most of my projects. So if you have this issue, it's most likely you have these lines in your css:

      *, *:before, *:after {
          -webkit-user-select: none;
          -khtml-user-select: none;
          -moz-user-select: none;
          -ms-user-select: none;
          user-select: none;
         }
    

    So just remove it or set it to default. And if your intention is to stop people from selecting stuff on your website, then make sure you reset this style property to default on inputs

      input, input:before, input:after {
          -webkit-user-select: initial;
          -khtml-user-select: initial;
          -moz-user-select: initial;
          -ms-user-select: initial;
          user-select: initial;
         } 
    

提交回复
热议问题