Skip to content
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

feat: ๐ŸŽธ Add SQFormMultiValue component #306

Merged
merged 6 commits into from
Jun 17, 2021

Conversation

20BBrown14
Copy link
Contributor

@20BBrown14 20BBrown14 commented Jun 16, 2021

Add new component, SQFormMultiValue

Loom: https://www.loom.com/share/e2405d5fbe1a42b7a7d0b457132c5593

Sorry for the loom length :/ the last half is just code, though, if you care about that.

โœ… Closes: #303

When this is approved I'll add an issue to add tests for this component
Post-merge edit: As promised, here is the issue for tests #307

Screen Shot 2021-06-17 at 8 57 34 AM

Add new component, SQFormMultiValue

โœ… Closes: #303 & #304
@20BBrown14 20BBrown14 linked an issue Jun 16, 2021 that may be closed by this pull request
@hvilander
Copy link
Contributor

Listening to your loom, what happens if I type in a string that is equal to the value of an option.

Example: options = { red: 1, blue: 2} and I type in 2.

@20BBrown14
Copy link
Contributor Author

Listening to your loom, what happens if I type in a string that is equal to the value of an option.

Example: options = { red: 1, blue: 2} and I type in 2.

Good question. So for your example, nothing. BEcause 2 and "2" are different. But if you had { red: 'color-red', blue: 'color-blue' } and you typed in "color-blue" you'll end up with just "Blue" in the options

seen here: https://www.loom.com/share/8f331a81f57c4bf5bb533cbc0c03d126

@Chris-Boyle
Copy link
Contributor

What happens if your selected options take up more width than the field?

package.json Outdated Show resolved Hide resolved
src/components/SQForm/SQFormMultiValue.js Show resolved Hide resolved
<SQFormMultiValue
name="favoriteColors"
label="Your Favorite Colors"
size={12}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storybook is great for what I call UI chaos testing.
I question what happens if we change this to size 6 then select all of the options. What happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question And so is

What happens if your selected options take up more width than the field?

It wraps the options and grows vertically when the options are more than allowed in the width. if a single option is longer than the width of the field it truncates the option label.

Screen Shot 2021-06-17 at 8 51 02 AM

Copy link
Contributor

@Chris-Boyle Chris-Boyle Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@20BBrown14 what is that little x all by itself on the right there? I didn't see that in the Loom. Does that clear all the fields including initial values? Make sure this gets ran by Chris as well since it wasn't part of the original Loom.
image

Copy link
Contributor Author

@20BBrown14 20BBrown14 Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pointed that out in the loom as a way to clear the field at about 43 seconds

edit: and is also how SQFormAutocomplete works so our users and devs should be familiar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pointed that out in the loom as a way to clear the field at about 43 seconds

edit: and is also how SQFormAutocomplete works so our users and devs should be familiar.

Yep. It's a great feature to have! I think you'll want to run the clear button by Nemeth. My hunch is he's going to want it to always stick to the bottom regardless of the number of rows so it's always in the same spot near the inputs bottom border. The default from MUI sort of looks likes its floating in no mans land.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nemeth wanted it on the bottom, this is what i was able to get
Screen Shot 2021-06-17 at 11 07 36 AM
Screen Shot 2021-06-17 at 11 07 22 AM

Revert react-scripts downgrade, update story
Made it so the little x button that clears the input is always near the
bottom of the input
@Chris-Boyle
Copy link
Contributor

We are missing component documentation for this component. Adding the validation example and reasoning would be good in the documentation.

@20BBrown14
Copy link
Contributor Author

We are missing component documentation for this component. Adding the validation example and reasoning would be good in the documentation.

I'm not sure what you're referring. Is there some documentation for the components I wish i knew about several months ago?

@Chris-Boyle
Copy link
Contributor

We do notes on some components. We used to do it a lot more. I am not sure where the stance is but it is nice to have for things that need a little more explanation.
https://github.com/SelectQuoteLabs/SQForm/tree/master/notes
Here is an example
https://5f4431386ea00a00220d495c-qfuecrbuoq.chromatic.com/?path=/docs/components-sqformdatepicker--date-picker-before-2024

Copy link
Contributor

@SeanGroff SeanGroff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work @20BBrown14!

@SeanGroff
Copy link
Contributor

Great job building this component @20BBrown14 , accepting PR feedback, and turning the feedback into a polished solution ๐Ÿ’ฏ

I stamped my approval, pending the removal of the package-lock.json that's still there.

@20BBrown14
Copy link
Contributor Author

We do notes on some components. We used to do it a lot more. I am not sure where the stance is but it is nice to have for things that need a little more explanation.
https://github.com/SelectQuoteLabs/SQForm/tree/master/notes
Here is an example
https://5f4431386ea00a00220d495c-qfuecrbuoq.chromatic.com/?path=/docs/components-sqformdatepicker--date-picker-before-2024

Ah, that's fair. I added a notes page that explains some stuff. Validation would probably be the trickiest thing. I also added component stories, which I left out originally.

@20BBrown14
Copy link
Contributor Author

Thanks for all the feedback and approvals. Merging since everything seems to be addressed ๐ŸŽ‰ ๐ŸŒฎ

@20BBrown14 20BBrown14 merged commit 79a1237 into master Jun 17, 2021
@20BBrown14 20BBrown14 deleted the issue-303_SQFormMultiValue branch January 12, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Autocomplete, Multiselect, free solo component
4 participants