Page 1 of 1

make read_only propery work on textfields

Posted: Sat Jun 20, 2026 1:14 pm
by Osmo
https://lua-api.factorio.com/latest/cla ... #read_only only applies to text-boxes, and for some reason, not textfields. They two elements should be basically the same in this regard, so given it exists, it would make sense and be useful on textfields as well.

Re: make read_only propery work on textfields

Posted: Sat Jun 20, 2026 8:27 pm
by Rseding91
text fields derive from text boxes so it should already work. In the same way the "car" entity prototype is also a vehicle which is also an entity. The Lua docs only show the least-required type needed for something.

Re: make read_only propery work on textfields

Posted: Sun Jun 21, 2026 8:28 am
by Osmo
Rseding91 wrote: Sat Jun 20, 2026 8:27 pm text fields derive from text boxes so it should already work. In the same way the "car" entity prototype is also a vehicle which is also an entity. The Lua docs only show the least-required type needed for something.
I know, and i tried, but it errored sayng it only works on text-boxes.
If it were a style property, it should work as they use the same style type, but this is an element property.

Re: make read_only propery work on textfields

Posted: Sun Jun 21, 2026 11:33 am
by Rseding91
Hmm, in that case the logic may be bugged.

Re: make read_only propery work on textfields

Posted: Sun Jun 21, 2026 11:38 am
by Osmo
The exact error is "Only callable on text-box.", in case that helps.

Re: make read_only propery work on textfields

Posted: Sun Jun 21, 2026 11:58 am
by Osmo
Some properties, for example icon_selector say
Can only be used if this is textfield or text-box
But read_only, as well as selectable which also looks like it should work but doesn't, say
Can only be used if this is text-box
word_wrap too, but that one does only make sense on text-boxes.

Re: make read_only propery work on textfields

Posted: Mon Jun 22, 2026 11:24 am
by Rseding91
This is now fixed for 2.1.

Re: make read_only propery work on textfields

Posted: Mon Jun 22, 2026 1:26 pm
by Osmo
Thank you