Skip to content

Commit

Permalink
STCOM-1282. Multiselection overlay overlapping input under certain co…
Browse files Browse the repository at this point in the history
…nditions. (#2269)

* if renderToOverlay is used, set the boundary to the overlay container

* log changes
  • Loading branch information
JohnC-80 committed Apr 25, 2024
1 parent 9fec08c commit ee7cea4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Exclude invalid additional currencies. Refs STCOM-1274.
* Validate ref in `Paneset` before dereferencing it. Refs STCOM-1235.
* Resolve bug with form control validation styles not rendering. Adjusted order of nested selectors. Refs STCOM-1284.
* `<MultiSelection/>`'s overlay will use the overlay container as its boundary when the `renderToOverlay` prop is applied, as opposed to the scrollParent of the control. Refs STCOM-1282.

## [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)
Expand Down
6 changes: 5 additions & 1 deletion lib/MultiSelection/OptionsListWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ const OptionsListWrapper = React.forwardRef(({
}

let portal;
const adjustedModifiers = modifiers;
if (renderToOverlay) {
portal = document.getElementById('OverlayContainer');
if (adjustedModifiers.preventOverflow) {
adjustedModifiers.preventOverflow.boundariesElement = portal;
}
}

return (
Expand All @@ -28,7 +32,7 @@ const OptionsListWrapper = React.forwardRef(({
isOpen={isOpen}
portal={portal}
placement="bottom-start"
modifiers={modifiers}
modifiers={adjustedModifiers}
hideIfClosed
>
{children}
Expand Down

0 comments on commit ee7cea4

Please sign in to comment.