make read_only propery work on textfields

This subforum contains all the issues which we already resolved.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

make read_only propery work on textfields

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16896
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: make read_only propery work on textfields

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: make read_only propery work on textfields

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16896
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: make read_only propery work on textfields

Post by Rseding91 »

Hmm, in that case the logic may be bugged.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: make read_only propery work on textfields

Post by Osmo »

The exact error is "Only callable on text-box.", in case that helps.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: make read_only propery work on textfields

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16896
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: make read_only propery work on textfields

Post by Rseding91 »

This is now fixed for 2.1.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: make read_only propery work on textfields

Post by Osmo »

Thank you
Post Reply

Return to “Resolved Problems and Bugs”