Skip to content

Commit

Permalink
UIU-3312 provide itemToString to correctly serialize options (#2843)
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
zburke authored Jan 16, 2025
1 parent f7cd893 commit a1087ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Add HTML page title to add/edit patron block page. Refs UIU-3302.
* Update fee/fine actions column UX for accessibility. Refs UIU-3027.
* 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.11](https://github.com/folio-org/ui-users/tree/v11.0.11) (2025-01-15)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.10...v11.0.11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const EditContactInfo = ({
fullWidth
disabled={disabled}
filter={prefEmailCommFilterOptions}
itemToString={(option) => option.value}
/>
</Col>
</Row>
Expand Down

0 comments on commit a1087ef

Please sign in to comment.