diff --git a/CHANGELOG.md b/CHANGELOG.md index e59367455..07629cf6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ * Use whole `dataOptions` array for memoization dependency rather that just `length` property. STCOM-1346. * Default the scope of `` to `document.body`. Remove internal wrapping div. Refs STCOM-1351. * Remove inline styling from `` content. Refs STCOM-1348. +* Use ``'s formatter for rendering the selected value within the field and prevent overflow of text. Refs STCOM-1344. ## [12.1.0](https://github.com/folio-org/stripes-components/tree/v12.1.0) (2024-03-12) [Full Changelog](https://github.com/folio-org/stripes-components/compare/v12.0.0...v12.1.0) diff --git a/lib/Selection/Selection.js b/lib/Selection/Selection.js index e8a10e124..e363ce873 100644 --- a/lib/Selection/Selection.js +++ b/lib/Selection/Selection.js @@ -212,7 +212,7 @@ const Selection = ({ } }, [dataOptions, selectedItem, value]) - const valueLabel = defaultItemToString(selectedItem) || placeholder || ''; + const valueLabel = formatter({ option: selectedItem }) || placeholder || ''; const labelId = `sl-label-${testId}`; const valueId = `selected-${testId}-item`;