【问题标题】:Is there a way to include the react-select dropdown near the body tag有没有办法在 body 标签附近包含 react-select 下拉菜单
【发布时间】:2019-10-17 16:53:18
【问题描述】:

我在使用 react-bootstrap 的 react 应用程序中包含了 react-select。

所以我有一个引导模态,其中的反应选择,问题是模态体设置为溢出自动,反应选择下拉现在而不是重叠模态,实际上产生滚动并部分隐藏.

有什么方法可以让选项列表在引导模式之外呈现(而 react-select 输入位于模式内部)?

React select dropdown inside modal (Image)

【问题讨论】:

  • 尝试将 z-index 增加到 react-select。

标签: reactjs react-bootstrap react-select


【解决方案1】:

这样做很有效:

对于风格:

    menuPortal: (provided) => ({
        ...provided,
        zIndex: 9999,
    }),

在组件上:

    menuPortalTarget={document.body}

【讨论】:

    猜你喜欢
    • 2011-02-12
    • 1970-01-01
    • 2018-08-02
    • 1970-01-01
    • 2021-09-20
    • 1970-01-01
    • 1970-01-01
    • 2016-09-26
    • 2021-08-01
    相关资源
    最近更新 更多