-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding element to array with @export_multiline
deletes previously entered items
#89288
Comments
Hi, I was able to reproduce this in 4.3, but not in 4.2.1, where it seems to work as intended.
This is true, but only if the cursor isn't inside the text field that's being reverted. If it is, adding an element will wipe the contents of that text field again. |
@export_multiline
deletes previously entered items
@tvenclovas96 Is it reproducible when you add an element through a script instead of through the inspector? |
@adamscott I'm not entirely sure what you mean. When running the project, the added string values will be detected, and values can be appended to the array as expected. This includes tool scripts. Modifying the exported array in the inspector after running will still delete the written strings, unless they were "set", such as by ctrl+z. If any default elements of the exported array are defined, they will be unaffected by this behavior. |
I tested this, GDScript provides the correct property info. It looks like this is an editor regression, the inspector seems to be caching old data. If you unselect the current node and select it again, then when you remove/add an element, other elements will be reset to their previous values, not necessarily empty. |
Bisecting points to #80706 as the culprit: |
Tested versions
Tested in 4.3 dev4 and 4.2 dev2
System information
Godot v4.3.dev3 - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.4601) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)
Issue description
When
@export_multiline
is used with an array of strings, if strings are set in the inspector, deleting or adding an element to the array in the inspector will clear the entered strings. Saving after entering the strings doesn't affect this behavior. Undoing with ctrl+z returns the strings and "sets" them, so they will no longer be cleared by adding or deleting an element.With regular
@export
, the strings can be set by pressing Enter and are not cleared when modifying the array. With@export_multiline
enter does not set the string, it adds a new line to the string.Steps to reproduce
Add the following line to a node or resource:
Write strings to 1 or more array elements in the inspector, then add or remove an element.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: