question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[terra-form-select] Array of numbers for MultiSelect produces proptype warnings

See original GitHub issue

Bug 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

image

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

@dev-cprice

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bjankordcommented, Sep 16, 2019

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.

1reaction
StephenEssercommented, Sep 10, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found