1

@font-face {
    font-family: "fontello";
    src: url("./font/fontello.eot?0000");
    src: url("./font/fontello.eot?0000#iefix") format("embedded-opentype"),
      url("./font/fontello.woff2?0000") format("woff2"),
      url("./font/fontello.woff?0000") format("woff"),
      url("./font/fontello.ttf?0000") format("truetype"),
      url("./font/fontello.svg?0000#fontello") format("svg");
    font-weight: normal;
    font-style: normal;
  }
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

<!-- begin snippet: js hide: false console: true babel: false -->
<input type="text" onChange={this.inputChange} value={this.state.inputValue}/>

So By using css font face in the input box how can we display asterisk characters.where I can show in UI and I can capture the original characters in onchange method and update to state and I have tried in this way but no use.

Note: value{*.repeat(this.state.inputValue)} I don't require this method

Akhil Raghav
  • 313
  • 1
  • 4
  • 16

1 Answers1

0

You can simply edit the unicode and download the webfonts in fontello and add that fonts folder in your code and you will good to go

Article: https://medium.com/@wowmotty/replace-the-input-password-bullet-1cd4ee34e0aa

Codesandbox: https://codesandbox.io/s/dank-tree-fwwty?file=/src/App.js

enter image description here

Thanks for the suggestion OP

Nisharg Shah
  • 16,638
  • 10
  • 62
  • 73