-
Notifications
You must be signed in to change notification settings - Fork 1.2k
hopefully fix combobox key issue #2582
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -459,9 +459,7 @@ function assignOptionIds( | |
( | ||
option: OptionDescriptor | ActionListItemDescriptor, | ||
optionIndex: number, | ||
) => { | ||
option.id = `${comboBoxId}-${optionIndex}`; | ||
}, | ||
) => ({id: `${comboBoxId}-${optionIndex}`, ...option}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we're not mutating the option anymore, or using the result of the map so it'll essentially a no-op. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AndrewMusgrave would you be able to run with the appropriate amendments. If this is dependent on me, I am doubtful this is going to get fixed. No care if it is my PR that lands. Just wanting the issue fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To use options.forEach(
(
option: OptionDescriptor | ActionListItemDescriptor,
optionIndex: number,
) => {
options[optionIndex] = {
...option,
id: `${comboBoxId}-${optionIndex}`,
};
},
);
return options; Also, in this fix I would not allow user to set his own id for option as you can see components still relies on his internal id naming in function |
||
); | ||
return options; | ||
} | ||
|
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.
This code was a little odd and might be obscuring what it's actually doing. Map returns a new array, however, we seem to be mutating the option and not using the result of the map. Ideally, we would have used a forEach, for, for of, etc.