Skip to content

Comments

ahres-2168 Remove invalid options for combobox component#1262

Merged
aaronmars merged 1 commit intomasterfrom
ahres-2169-remove-invalid-options-for-combobox
Feb 12, 2025
Merged

ahres-2168 Remove invalid options for combobox component#1262
aaronmars merged 1 commit intomasterfrom
ahres-2169-remove-invalid-options-for-combobox

Conversation

@sidiinia
Copy link
Contributor

Fix: Ensure selected options array does not contain undefined values

@kermitapp
Copy link

kermitapp bot commented Jan 30, 2025

@sidiinia sidiinia force-pushed the ahres-2169-remove-invalid-options-for-combobox branch 2 times, most recently from 2612d06 to 96528ed Compare January 30, 2025 16:34
multi
? (value || []).map((v: T) => options.find((option) => equal(option.value, v)))
? (value || [])
.map((v: T) => options.find((option) => equal(option.value, v)))
Copy link
Contributor

Choose a reason for hiding this comment

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

you could write this a bit more efficiently with reduce if you wanted, but also fine as is

.reduce<Option<T>[]>((acc, v) => {
      const found = options.find((option) => equal(option.value, v));
      if (found) acc.push(found);
      return acc;
    }, [])

@DistractedPrimate
Copy link

Open question (non blocking): Is there a way that we can somehow log when the combobox is receiving invalid parameters? Would be nice to know when we are passing bad params in a way that doesn't crash pages.

@JeremyRH
Copy link
Contributor

Open question (non blocking): Is there a way that we can somehow log when the combobox is receiving invalid parameters? Would be nice to know when we are passing bad params in a way that doesn't crash pages.

@DistractedPrimate TypeScript should handle this. Logs sometimes get ignored.

@JeremyRH
Copy link
Contributor

JeremyRH commented Jan 31, 2025

@sidiinia Your commit messages must follow conventional commits. E.g. fix(Combobox): Ensure selected options array does not contain undefined values

@ztmeyer ztmeyer force-pushed the ahres-2169-remove-invalid-options-for-combobox branch from 96528ed to be35d6a Compare February 11, 2025 22:40
@github-actions
Copy link
Contributor

Released prerelease version 8.14.3-ahres-2169-remove-invalid-options-for-combobox-c739139.0.
You may now run npm install @appfolio/react-gears@ahres-2169-remove-invalid-options-for-combobox

@aaronmars aaronmars merged commit 80e55e2 into master Feb 12, 2025
4 checks passed
@aaronmars aaronmars deleted the ahres-2169-remove-invalid-options-for-combobox branch February 12, 2025 00:05
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.

6 participants