-
Notifications
You must be signed in to change notification settings - Fork 7
Various Dropdown bugs #532
Conversation
🦋 Changeset detectedLatest commit: caee158 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2e09a57
to
6b81a5c
Compare
6b81a5c
to
7774576
Compare
7774576
to
547a5e4
Compare
'@crowdstrike/glide-core': patch | ||
--- | ||
|
||
- Multiselect Dropdown no longer adds duplicate values to `value` when `value` is set programmatically and the options corresponding to those values are already selected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Halp! What a mouthful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😂😂😂
Could be a good case for simplifying the release note even though it doesn't paint the full picture?
- Multiselect Dropdown no longer adds duplicate values to `value` when `value` is set programmatically and the options corresponding to those values are already selected. | |
- Multiselect Dropdown no longer adds duplicate values to `value`. |
It leaves off some pertinent information though, which is a bummer for folks who would be interested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I both dig it and don't. I like the brevity. But I don't like that it may send that message that multiselect Dropdown in all cases added duplicate values—when it fact it was only in a specific case.
I leave it to you! 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep what you got!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep what you got!
547a5e4
to
26c81a7
Compare
observer.observe(dropdown, { | ||
attributes: true, | ||
attributeFilter: ['open'], | ||
attributeFilter: ['open', 'value'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that programmatic changes to value
, which don't have a "change" event, are reflected in the code example.
7d4c526
to
9ebea62
Compare
9ebea62
to
c13f829
Compare
storyId: context.id, | ||
updatedArgs: { | ||
value: dropdown.value, | ||
'<glide-core-dropdown-option>.one.selected': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to checking dropdown.value.includes()
in the template so additionally each option's selected
attribute is reflected in the code example when value
is changed via the Storybook control.
'@crowdstrike/glide-core': patch | ||
--- | ||
|
||
- Multiselect Dropdown no longer adds duplicate values to `value` when `value` is set programmatically and the options corresponding to those values are already selected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😂😂😂
Could be a good case for simplifying the release note even though it doesn't paint the full picture?
- Multiselect Dropdown no longer adds duplicate values to `value` when `value` is set programmatically and the options corresponding to those values are already selected. | |
- Multiselect Dropdown no longer adds duplicate values to `value`. |
It leaves off some pertinent information though, which is a bummer for folks who would be interested.
🚀 Description
A few minor bugs I came across recently:
value
whenvalue
is set programmatically and the options corresponding to those values are already selected.multiple
is set programmatically and an option is selected.📋 Checklist
🔬 How to Test
Multiselect Dropdown no longer adds duplicate values to
value
whenvalue
is set programmatically and the options corresponding to those values are already selectedvalue
property to['one']
.value
property is equal to['one']
.Filterable single-select Dropdown now sets the
value
of its input field to the label of the selected option on first rendervalue
of the input field is equal to thelabel
of the first selected option.Filterable Dropdown now clears its input field when
multiple
is set programmatically and an option is selectedmultiple
totrue
programmatically.📸 Images/Videos of Functionality
N/A