Page 1 of 1

[0.17.68] Textfields ignore constraints on copy-paste

Posted: Wed Sep 04, 2019 8:47 pm
by Therenas
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).

Re: Textfields ignore constraints on copy-paste

Posted: Wed Sep 04, 2019 8:53 pm
by Klonan
This seems more like a bug than an interface request to me

moving to bug reports

Re: Textfields ignore constraints on copy-paste

Posted: Wed Sep 04, 2019 8:56 pm
by Therenas
Thanks Klonan, wasn't sure where to put it.

Re: [0.17.68] Textfields ignore constraints on copy-paste

Posted: Thu Sep 05, 2019 2:33 pm
by posila
It's fixed for the next release.