Skip to content
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

UIU-3312 provide itemToString to correctly serialize options #2843

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
UIU-3312 provide itemToString to correctly serialize options
`MultiSelection` creates unique `key` attributes for its options with a
default function of
```
(option) => option ? option.label : ''
```
but the `label` attribute here is a `<FormattedMessage>, leading that
function to serialize all options as `[object Object]`. Since we know
the `value` attribute here is a unique string, we use that instead.

Refs UIU-3312
zburke committed Jan 15, 2025
commit 85475e1bccc2fa736fab3d4fa8ba805bdc16e124
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
* Update fee/fine actions column UX for accessibility. Refs UIU-3027.
* Rename permission after BE changes. Refs UIU-3309.
* Change import of `exportToCsv` from `stripes-util` to `stripes-components`. Refs UIU-3202.
* Provide `itemToString` to create unique `key` attributes. Refs UIU-3312.

## [11.0.10](https://github.com/folio-org/ui-users/tree/v11.0.10) (2025-01-10)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.9...v11.0.10)
Original file line number Diff line number Diff line change
@@ -136,6 +136,7 @@ const EditContactInfo = ({
fullWidth
disabled={disabled}
filter={prefEmailCommFilterOptions}
itemToString={(option) => option.value}
/>
</Col>
</Row>