[0.17.68] Textfields ignore constraints on copy-paste
Posted: Wed Sep 04, 2019 8:47 pm
Recently, textfields got the ability to constrain what users could enter into them, namely numeric, allow_decimal and allow_negative. This works great when the user is inputting text by typing it directly on their keyboard. Any characters that aren't allowed are simply dropped. However, this is not the case when copy-pasting into those fields, in which case the textfield accepts any string, regardless of the constraints that are set.
This is annoying for modders, because now we have to verify the input anyways, even if we set the constraints appropriately, which defeats part of the purpose of them. So I propose that copy-pasting invalid characters into textfields with constraints should either not paste an invalid string at all, or strip all invalid characters from them (Probably the latter).
This is annoying for modders, because now we have to verify the input anyways, even if we set the constraints appropriately, which defeats part of the purpose of them. So I propose that copy-pasting invalid characters into textfields with constraints should either not paste an invalid string at all, or strip all invalid characters from them (Probably the latter).