+
Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Conversation

clintcs
Copy link
Collaborator

@clintcs clintcs commented Dec 16, 2024

🚀 Description

A few minor bugs I came across recently:

  • Multiselect Dropdown no longer adds duplicate values to value when value is set programmatically and the options corresponding to those values are already selected.
  • Filterable single-select Dropdown now sets the value of its input field to the label of the selected option on first render.
  • Filterable Dropdown now clears its input field when multiple is set programmatically and an option is selected.

📋 Checklist

🔬 How to Test

Multiselect Dropdown no longer adds duplicate values to value when value is set programmatically and the options corresponding to those values are already selected

  1. Navigate to multiselect Dropdown in Storybook.
  2. Programmatically set Dropdown's value property to ['one'].
  3. Verify that Dropdown's 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 render

  1. Navigate to single-select filterable Dropdown in Storybook.
  2. Verify the value of the input field is equal to the label of the first selected option.

Filterable Dropdown now clears its input field when multiple is set programmatically and an option is selected

  1. Navigate to single-select filterable Dropdown in Storybook.
  2. Set multiple to true programmatically.
  3. Verify the input field is empty.

📸 Images/Videos of Functionality

N/A

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: caee158

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@crowdstrike/glide-core Patch

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

@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch from 2e09a57 to 6b81a5c Compare December 16, 2024 17:16
Copy link
Contributor

@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch from 6b81a5c to 7774576 Compare December 16, 2024 18:06
@clintcs clintcs changed the title Fix multiselect Dropdown value bug Fix various Dropdown bugs Dec 16, 2024
@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch from 7774576 to 547a5e4 Compare December 16, 2024 18:10
'@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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Halp! What a mouthful.

Copy link
Collaborator

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?

Suggested change
- 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.

Copy link
Collaborator Author

@clintcs clintcs Dec 16, 2024

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! 😆

Copy link
Collaborator

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!

Copy link
Collaborator

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!

@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch from 547a5e4 to 26c81a7 Compare December 16, 2024 18:16
observer.observe(dropdown, {
attributes: true,
attributeFilter: ['open'],
attributeFilter: ['open', 'value'],
Copy link
Collaborator Author

@clintcs clintcs Dec 16, 2024

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.

@clintcs clintcs changed the title Fix various Dropdown bugs Various Dropdown bugs Dec 16, 2024
@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch 2 times, most recently from 7d4c526 to 9ebea62 Compare December 16, 2024 18:27
@clintcs clintcs marked this pull request as ready for review December 16, 2024 18:29
@clintcs clintcs force-pushed the fix-multiselect-dropdown-value-bug branch from 9ebea62 to c13f829 Compare December 16, 2024 19:02
storyId: context.id,
updatedArgs: {
value: dropdown.value,
'<glide-core-dropdown-option>.one.selected':
Copy link
Collaborator Author

@clintcs clintcs Dec 16, 2024

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.
Copy link
Collaborator

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?

Suggested change
- 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.

@clintcs clintcs merged commit f5ee762 into main Dec 17, 2024
7 checks passed
@clintcs clintcs deleted the fix-multiselect-dropdown-value-bug branch December 17, 2024 14:57
@github-actions github-actions bot mentioned this pull request Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载