[terra-form-select] Array of numbers for MultiSelect produces proptype warnings
See original GitHub issueBug Report
Description
Previously on terra-form-select 5.25.0, given a multiple variant (MultiSelect or TagSelect), we could pass a list of numbers for the value prop:
Select.jsx:100 SelectField.jsx:102
<Select
variant={'multiple'}
value={[12, 34, 56, 78]}
>
{...}
</Select>
When the large refactor happened for terra-form-select 5.26.0, the proptype validation requires value to be an array of strings. MultiSelect.jsx:93
Steps to Reproduce
Create a Select component with a ‘multiple’ variant Set the value to an array of numbers Receive proptype validation warnings
Additional Context / Screenshots
Expected Behavior
This code would not produce a proptype error.
Possible Solution
Update MultiSelect.jsx:93 to accept an array of numbers or strings
Environment
- Component Name and Version: terra-form-select@5.26.0+
- Browser Name and Version: Latest Chrome
- Node/npm Version: Node 8, npm 5
- Operating System and version (desktop or mobile): Any
@ Mentions
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Type Constraints - Configuration Language | Terraform
A complex type is a type that groups multiple values into a single value. Complex types are represented by type constructors, but several...
Read more >map list of maps to a list of selected field values in terraform
I'm looking for a possibility to do the same for varaibles I can do for multi resources: a projection of an array to...
Read more >Regex validation/format for input blocks, output ... - GitHub
terraform will need to automatically generate "valid" values at the top of the tree and during plan, pass those values all the way...
Read more >Book Review: Terraform in Action - AdinErmie.com
Instead they plan to make money by offering specialized tooling that makes it easier to run Terraform in high-scale, multi-tenant environments.
Read more >SweetOps #terraform for March, 2021
My first question is about the terraform-aws-rds-cluster module. I see the input “enabled_cloudwatch_logs_exports” we can use to select ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My preference is let’s allow the previous behavior (let Single Selection variants to accept an array) to keep the functionality passive. When we do the next MVB for this package, we can reconsider how we want that to work.
This was not a bug prior to the changes made in v5.25.0. The Select had a consistent PropType expectation for all variants.
This worked both ways, the multiple Select variant could also accept a string as a defaultValue.
This avoided a complex prop driven custom PropType validator and allowed consistent behavior and expectations between all variants.
As the Select is being broken out into individual resources I do think the more strict PropTypes are appropriate. I do not think the
<SearchSelect />
should accept an array. The issue is being passive with the original<Select />
API.