How can I style text input as I type?

前端 未结 3 1566
予麋鹿
予麋鹿 2021-01-12 14:15

Every time I type a character in an input field, I parse the expression so that I get:

  1. An array of tokens, i.e., tokenArray=[2, *, COS, (, 4, )]
  2. A cor
3条回答
  •  清歌不尽
    2021-01-12 14:42

    You can sort of hack styling behind it if it's just for unimportant aesthetics.

    • Make the background and the text of the transparent
    • Have another behind it
    • Update the content of the (with appropriate styling) when the 's contents change

    Here's a quick demo.

提交回复
热议问题