From da375e0aceab60d72018f9dd085c98ad620e52bc Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Wed, 13 Jan 2021 17:59:07 +0000 Subject: [PATCH] visual/TextInput: replace for...in with a forEach loop --- js/visual/TextInput.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/js/visual/TextInput.js b/js/visual/TextInput.js index a662c34..aa01f78 100644 --- a/js/visual/TextInput.js +++ b/js/visual/TextInput.js @@ -674,14 +674,15 @@ export class TextInput extends PIXI.Container let states = ['DEFAULT', 'FOCUSED', 'DISABLED']; let input_bounds = this._getDOMInputBounds(); - for (let i in states) - { - this._box_cache[states[i]] = this._box_generator( - input_bounds.width, - input_bounds.height, - states[i] - ); - } + states.forEach((state) => + { + this._box_cache[state] = this._box_generator( + input_bounds.width, + input_bounds.height, + state + ); + } + ); this._previous.input_bounds = input_bounds; }