Space added into string in Select component

Default value (string) gets extra spaces when displayed in the select component. And is also saved in table with extra space when submitting the value from the select component. Changing the original values. Can't make it go away???

I can't seem to replicate this - can you show what the options look like for each of the entries? ie:
image

Hi dcartlidge

Thanks for looking into this. It isn't the display of the option values that's the problem. It is the dynamic input for the default value before an option is chosen. As the screenshot shows, the dynamic default input is GCU_V2, but is displayed as GCU V 2. The GCU V 2 (with spaces) isn't even in the option list. See picture
The select component has fuzzy match and allow custom values enabled. If not nothing is displayed. Even though the default input string match one of the options. Hope you can help with this, thanks

That's strange and I'm still unable to reproduce it:


forum (1).json (13.7 KB)

If you change the default to be a hardcoded value of GCU_V2 does it work?
If you create an entirely new select component and populate it with the same options does the same issue occur - I'm wondering if there's some event handler or other component which is affecting this select box.
Maybe if you check the state tab in debug for this component there may be some other component that is using it?

Hi dcartlidge
Found the error/feature. In the table which is the source for the form where the select component is placed, the column gcu_ver had this sting under mapped value: {{ _.startCase(item) }}. Deleting it, removed the extra spaces. Problem solved. Was not aware of this string control, or that the table property overrules the component setting.

Found it by setting the default value to a fixed string. When opening the app, the fixed string flashed shortly before it was overwritten.
Thanks for the help

1 Like

Which sounds like you're using the formatted/presentation table data as the source, not the underlying/raw data from the query? Your screenshots suggested that you were using the query data though? A little confused but happy you've resolved it

1 Like