Mwni / pixi-text-input

Plugin for pixi.js which provides a convenient way of adding a text input to the pixijs-stage.
161 stars 44 forks source link

Does not handle type 'password' #31

Closed radrevere closed 3 years ago

radrevere commented 3 years ago

_deriveSurrogateText on line 423 needs to be updated to handle password type. The following is the code I used to handle it for my project: _proto._deriveSurrogateText = function _deriveSurrogateText() { var txt = this._dom_input.value; if(this._dom_input.value.length === 0) { txt = this._placeholder; }else if(this._dom_input.type == 'password'){ txt = "•".repeat(this._dom_input.value.length); } return txt; };

Mwni commented 3 years ago

Thank you for this. Do you have a fork form which you can make a pull request or should I do it myself and credit you in the commit?

radrevere commented 3 years ago

You are welcome. I didn't fork it so you can feel free to make any changes so that it matches your coding standards.

Mwni commented 3 years ago

Checked and merged. Have a good weekend.