The unicode-bidi property doesn't work on HTML Input Placeholder

548 Views Asked by At
Unicode Bidirectional override fails for Input Placeholders.

Unicode Bidirectional fails for Input placeholder , below is the MARKUP with html and CSS(having rtl implementation and unicode bidirectional overide) and output for the same.

<!DOCTYPE html>
<html>
<head>
  <style>
      * {
      direction: rtl !important;
      unicode-bidi: bidi-override !important;
    }
  </style>
</head>
  <body>

    <h1>The unicode-bidi Property</h1>

    <div>Some text. Default writing direction.</div>
    <div class="ex1">Some text. Right-to-left direction.</div>
    <input placeholder="abc def"/>

  </body>
</html>

The output with failing bidirectional for placeholder

https://www.w3schools.com/code/tryit.asp?filename=G37SI0TRBPPM

1

There are 1 best solutions below

2
On BEST ANSWER

You need to add placeholder css:

Here is the updated fiddle:

* {
  direction: rtl;
  unicode-bidi: bidi-override;
}

input[type="text"]:-moz-placeholder {
  unicode-bidi: bidi-override;
}

input[type="text"]:-ms-input-placeholder {
  unicode-bidi: bidi-override;
}

input[type="text"]::-webkit-input-placeholder {
  unicode-bidi: bidi-override;
}
<!DOCTYPE html>
<html>

<head>

</head>

<body>

  <div class="ex1">Some text. Right-to-left direction.</div>
  <input type="text" placeholder="abc def" />

</body>

</html>