ahres-2168 Remove invalid options for combobox component#1262
ahres-2168 Remove invalid options for combobox component#1262
Conversation
|
Jira Issue: https://appfolio.atlassian.net/browse/ahres-2168 |
2612d06 to
96528ed
Compare
| multi | ||
| ? (value || []).map((v: T) => options.find((option) => equal(option.value, v))) | ||
| ? (value || []) | ||
| .map((v: T) => options.find((option) => equal(option.value, v))) |
There was a problem hiding this comment.
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;
}, [])
|
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. |
|
@sidiinia Your commit messages must follow conventional commits. E.g. |
96528ed to
be35d6a
Compare
|
Released prerelease version |
Fix: Ensure selected options array does not contain undefined values