I have a form (view) where a user can enter data for an object to be saved to a table.
One of the inputs is a dropdown that allows custom options (allowCustomOptions: True
).
There is a similar form (view) used to allow edits to the object.
When I set the value of the (single select) dropdown from the view.root.onStartup
script and that value was not one of the dropdown options (as allowed), the dropdown appears as if it has nothing selected at all, even when the internal props.value
of the dropdown is set to the correct value.
In hindsight, this doesn't have anything to do with the startup script. This was just how I ended up finding this bug.
I have observed this behavior when the value set on startup is an integer, but not when it's a string. This is what makes me think this is a bug. Integers are a valid data type for props.value
, so they should work the same as strings.
The Bug
When Dropdown.props.value == 1 and 1 not in Dropdown.props.options
, we get:
When Dropdown.props.value == "1" and "1" not in Dropdown.props.options
, we get:
Integer
String
Ignition v8.1.35