有没有办法在 body 标签附近包含 react-select 下拉列表
Is there a way to include the react-select dropdown near the body tag
我在使用 react-bootstrap.
的 React 应用程序中包含了 react-select
所以我有一个 bootstrap 模态,里面有反应 select,问题是模态主体设置为自动溢出,现在反应 select 下拉菜单而不是重叠模态,实际上会产生一个滚动并部分隐藏。
有什么方法可以让选项列表在 bootstrap 模态之外呈现(而 react-select 输入位于模态内部)?
React select dropdown inside modal (Image)
这样做有效:
适用款式:
menuPortal: (provided) => ({
...provided,
zIndex: 9999,
}),
在组件上:
menuPortalTarget={document.body}
我在使用 react-bootstrap.
的 React 应用程序中包含了 react-select所以我有一个 bootstrap 模态,里面有反应 select,问题是模态主体设置为自动溢出,现在反应 select 下拉菜单而不是重叠模态,实际上会产生一个滚动并部分隐藏。
有什么方法可以让选项列表在 bootstrap 模态之外呈现(而 react-select 输入位于模态内部)?
React select dropdown inside modal (Image)
这样做有效:
适用款式:
menuPortal: (provided) => ({
...provided,
zIndex: 9999,
}),
在组件上:
menuPortalTarget={document.body}