You need to enable JavaScript to run this app. React中使用reactstrap的导航栏Dropdown被尺寸限制如何解决
优惠活动
大模型
产品
解决方案
定价
更多

React中使用reactstrap的导航栏Dropdown被尺寸限制如何解决

reactstrap下拉菜单被导航栏裁剪问题

我参考了reactstrap的Dropdown组件官方示例编写代码,目前导航栏中用到的Dropdown相关代码如下:

<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}>
  <DropdownToggle caret>
    Dropdown Test
  </DropdownToggle>
  <DropdownMenu>
    <DropdownItem disabled>Action</DropdownItem>
    <DropdownItem>Another Action</DropdownItem>
    <DropdownItem divider />
    <DropdownItem>Another Action</DropdownItem>
  </DropdownMenu>
</Dropdown>

目前弹出的Dropdown菜单会被导航栏的固有尺寸限制,请问该怎么突破这个限制?实际效果可参考两张示例截图。
我不想通过修改header的CSS来解决问题,比如类似下面的写法就不在考虑范围内:

ul {
  height: 10rem 
}

我编写的JSX代码篇幅过长没法直接贴出,完整代码已托管在线上代码编辑平台,麻烦各位帮忙解答。
——Jeff

内容的提问来源于stack exchange,提问作者Man Man Yu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.28 18:15:02