Skip to content

feat(Tabs): support showSearch in more dropdown#992

Open
EmilyyyLiu wants to merge 2 commits into
react-component:masterfrom
EmilyyyLiu:feat/add-showSearch
Open

feat(Tabs): support showSearch in more dropdown#992
EmilyyyLiu wants to merge 2 commits into
react-component:masterfrom
EmilyyyLiu:feat/add-showSearch

Conversation

@EmilyyyLiu

@EmilyyyLiu EmilyyyLiu commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

概述

为 Tabs 组件的更多下拉菜单添加搜索功能,类似于 Select 组件的 showSearch 特性。

相关 Issue

ant-design/ant-design#30719

改动内容

  • src/interface.ts: 添加 ShowSearchConfig 类型和 showSearch 属性到 MoreProps
  • src/TabNavList/OperationNode.tsx: 实现搜索功能
    • 启用 showSearch 时显示搜索框
    • 根据搜索值过滤 tabs
    • 支持受控/非受控模式
    • 关闭下拉框时自动清空搜索值
    • 键盘导航在过滤后的结果中生效
  • assets/dropdown.less: 添加搜索框样式
  • docs/examples/search-dropdown.tsx: 添加示例
  • README.md: 更新 API 文档
  • tests/overflow.test.tsx: 添加测试

使用方法

// 基础用法
<Tabs more={{ showSearch: true }} items={items} />

// 完整配置
<Tabs
  more={{
    showSearch: {
      placeholder: '搜索...',
      searchValue,  // 受控
      onSearch,     // 回调
      autoClearSearchValue: false  // 关闭时保留搜索值
    }
  }}
  items={items}
/>

测试结果

全部 76 个测试通过。

Summary by CodeRabbit

  • 新功能
    • “更多”下拉新增可选搜索:支持 icon、开启/关闭、以及自定义占位符、受控搜索值、onSearch 回调与自动清空开关。
    • 新增搜索下拉示例页面(基础、受控、保留搜索值)。
  • 文档
    • 补充 more 相关 API 说明与 MoreProps 字段列表,包括 showSearch 配置项。
  • Bug 修复
    • 优化带搜索时的下拉布局、菜单滚动与键盘/回车交互,并改善选中项滚动对齐效果。

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f0705ec-0322-44b4-b882-97659513cf8f

📥 Commits

Reviewing files that changed from the base of the PR and between f22edac and 186feeb.

📒 Files selected for processing (1)
  • docs/examples/search-dropdown.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/examples/search-dropdown.tsx

Walkthrough

新增 more.showSearch 配置及其类型说明,OperationNode 支持更多下拉内搜索、过滤、键盘导航和受控搜索值,并同步更新样式、示例文档与测试。

Changes

搜索下拉支持

Layer / File(s) Summary
API 契约
src/interface.ts, README.md
新增 ShowSearchConfigMoreProps.showSearch,并在 README 中补充 moreMoreProps 的配置说明。
搜索过滤与交互
src/TabNavList/OperationNode.tsx
OperationNode 解析搜索配置,生成 filteredTabs,并将菜单渲染、键盘导航、输入交互和 overlay 结构切换到搜索模式。
下拉样式
assets/dropdown.less
下拉面板补充隐藏态、搜索容器、顶部搜索栏和菜单滚动布局。
示例与测试
docs/demo/search-dropdown.md, docs/examples/search-dropdown.tsx, tests/overflow.test.tsx
新增 search-dropdown 演示页与示例组件,并补充输入框渲染、占位符、输入更新和 onSearch 调用的测试。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • react-component/tabs#784: 也调整了 src/TabNavList/OperationNode.tsx 的下拉层相关行为,与本 PR 的 more 下拉结构变化直接相关。
  • react-component/tabs#990: 同样涉及 src/TabNavList/OperationNode.tsx,与本 PR 在同一组件内的改动有代码级关联。

Suggested reviewers

  • zombieJ

Poem

我是一只小兔,蹦进 more 的门,
鼻尖闻到搜索框,词儿一输就分门。
方向键轻轻跳,菜单排排站稳,
Tabs 眨眨眼:哎呀,找到了那一份。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题简洁明确,准确概括了 Tabs 的 more 下拉菜单新增 showSearch 支持这一主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/examples/search-dropdown.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a search feature within the tabs overflow dropdown, allowing users to filter tabs. It includes documentation, styling, a demo, and unit tests. The review feedback highlights three key areas for improvement: first, safely extracting text from tab.label since it can be a React node rather than a plain string; second, resetting the selected key when the active tab is filtered out to prevent selecting hidden tabs; and third, enhancing accessibility by auto-focusing the search input upon opening and supporting the Escape key to close the dropdown.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +80 to +82
const filteredTabs = mergedSearchValue
? tabs.filter(tab => String(tab.label).toLowerCase().includes(mergedSearchValue.toLowerCase()))
: tabs;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

rc-tabs 中,tab.label 的类型是 React.ReactNode。如果用户传入了非字符串的 React 节点(例如包含图标或 HTML 标签的 <span>Tab 1</span>),直接使用 String(tab.label) 会得到 "[object Object]",导致搜索过滤失效,甚至在搜索 "object" 时错误地匹配到所有这类 Tab。

建议实现一个简单的文本提取函数,或者在过滤时安全地处理非字符串类型的 label

  const getLabelText = (node: React.ReactNode): string => {
    if (!node) return '';
    if (typeof node === 'string' || typeof node === 'number') {
      return String(node);
    }
    if (React.isValidElement(node) && node.props && 'children' in node.props) {
      return getLabelText(node.props.children);
    }
    if (Array.isArray(node)) {
      return node.map(getLabelText).join('');
    }
    return '';
  };

  const filteredTabs = mergedSearchValue
    ? tabs.filter(tab => getLabelText(tab.label).toLowerCase().includes(mergedSearchValue.toLowerCase()))
    : tabs;

Comment on lines 233 to +245
useEffect(() => {
if (!open) {
if (open) {
// 打开时,默认选中当前 activeKey 对应的 tab
if (!selectedKey && activeKey) {
setSelectedKey(activeKey);
}
} else {
setSelectedKey(null);
if (autoClearSearchValue && controlledSearchValue === undefined) {
setSearchValue('');
}
}
}, [open]);
}, [open, activeKey]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

当启用搜索并输入关键字过滤 Tab 时,如果当前选中的 selectedKey 被过滤掉了(不再显示在列表中),按下 Enter 键仍然会触发 onTabClick(selectedKey),导致选中了一个已被隐藏的 Tab。此外,键盘上下键导航也会从一个不可见的项开始,导致体验不佳。

建议在 filteredTabs 变化时,如果当前的 selectedKey 不在过滤后的可见列表中,自动将 selectedKey 重置为过滤后列表中的第一个有效项。

  useEffect(() => {
    if (open) {
      // 打开时,默认选中当前 activeKey 对应的 tab
      if (!selectedKey && activeKey) {
        setSelectedKey(activeKey);
      }
    } else {
      setSelectedKey(null);
      if (autoClearSearchValue && controlledSearchValue === undefined) {
        setSearchValue('');
      }
    }
  }, [open, activeKey]);

  useEffect(() => {
    if (open && isSearchable) {
      const enabledTabs = filteredTabs.filter(tab => !tab.disabled);
      if (enabledTabs.length > 0 && !enabledTabs.some(tab => tab.key === selectedKey)) {
        setSelectedKey(enabledTabs[0].key);
      } else if (enabledTabs.length === 0) {
        setSelectedKey(null);
      }
    }
  }, [open, filteredTabs, isSearchable, selectedKey]);

Comment on lines +195 to +222
const searchInput = isSearchable ? (
<div className={`${dropdownPrefix}-search`}>
<input
type="text"
placeholder={placeholder}
value={mergedSearchValue}
onChange={e => {
const value = e.target.value;
setSearchValueFn(value);
onSearch?.(value);
}}
onKeyDown={e => {
if (e.key === 'ArrowDown') {
e.preventDefault();
selectOffset(1);
} else if (e.key === 'ArrowUp') {
e.preventDefault();
selectOffset(-1);
} else if (e.key === 'Enter' && selectedKey) {
e.preventDefault();
onTabClick(selectedKey, e);
setOpen(false);
}
}}
onClick={e => e.stopPropagation()}
/>
</div>
) : null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了提升用户体验和无障碍支持(Accessibility),建议在搜索框中加入以下改进:

  1. 自动聚焦(Auto-focus):当下拉菜单打开且启用了搜索时,搜索输入框应该自动获得焦点,方便用户直接开始输入。
  2. 支持 Esc 键关闭:在输入框中按下 Esc 键时,应该能够关闭下拉菜单。
  const searchInput = isSearchable ? (
    <div className={`${dropdownPrefix}-search`}>
      <input
        ref={node => {
          if (node && open && document.activeElement !== node) {
            setTimeout(() => node.focus(), 0);
          }
        }}
        type="text"
        placeholder={placeholder}
        value={mergedSearchValue}
        onChange={e => {
          const value = e.target.value;
          setSearchValueFn(value);
          onSearch?.(value);
        }}
        onKeyDown={e => {
          if (e.key === 'ArrowDown') {
            e.preventDefault();
            selectOffset(1);
          } else if (e.key === 'ArrowUp') {
            e.preventDefault();
            selectOffset(-1);
          } else if (e.key === 'Escape') {
            e.preventDefault();
            setOpen(false);
          } else if (e.key === 'Enter' && selectedKey) {
            e.preventDefault();
            onTabClick(selectedKey, e);
            setOpen(false);
          }
        }}
        onClick={e => e.stopPropagation()}
      />
    </div>
  ) : null;

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.33333% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.58%. Comparing base (926f67e) to head (186feeb).

Files with missing lines Patch % Lines
src/TabNavList/OperationNode.tsx 73.33% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #992      +/-   ##
==========================================
- Coverage   98.98%   97.58%   -1.41%     
==========================================
  Files          18       18              
  Lines         787      827      +40     
  Branches      232      256      +24     
==========================================
+ Hits          779      807      +28     
- Misses          8       20      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
tests/overflow.test.tsx (1)

675-746: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

建议把回归测试补到关闭清空和键盘导航。

Line 675-746 目前只覆盖了输入渲染、筛选和 onSearch。这次改动里更容易回归的是默认 autoClearSearchValue=true 的关闭清空,以及 ArrowUp/ArrowDown/Enter 的键盘选择流程,建议顺手补上这两类断言。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/overflow.test.tsx` around lines 675 - 746, Current tests in
overflow.test.tsx only cover rendering, filtering, and onSearch in the search
dropdown; add regression coverage for the default autoClearSearchValue=true
behavior and the keyboard navigation/selection flow. Extend the existing
overflow dropdown tests around getTabs, showSearch, and the rc-tabs-dropdown
input to assert that the search value clears appropriately after selection when
autoClearSearchValue is enabled. Also add key event coverage for ArrowUp,
ArrowDown, and Enter to verify the dropdown item focus and selection path does
not regress.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/examples/search-dropdown.tsx`:
- Around line 53-56: Search-dropdown 示例里的 Tabs 被固定为 activeKey="1" 且 onChange
被忽略,导致点击搜索结果切换标签无效;请在 search-dropdown.tsx 中为 Tabs 单独维护一个 activeKey 状态,并在
onChange 里更新它,让受控的 searchValue 与 tab 切换状态分离,保持示例可正常切换。

In `@README.md`:
- Around line 121-132: The new `more` / `MoreProps` API table entries in the
README are written in Chinese while the rest of the document is English; update
these descriptions to English to keep the public documentation language
consistent. Please revise the `MoreProps` section and its nested fields (`icon`,
`showSearch`, `placeholder`, `searchValue`, `onSearch`, `autoClearSearchValue`)
so the wording matches the surrounding README style.

In `@src/TabNavList/OperationNode.tsx`:
- Around line 145-147: `OperationNode` needs to keep `selectedKey` in sync with
the current `filteredTabs` result set. Update the selection logic around
`enabledTabs`, the Enter handler, and the `open`/`filteredTabs` effect so
`selectedKey` is always coerced to a valid key in the visible tabs (prefer
current `activeKey`, otherwise the first enabled tab, otherwise `null`). Also
fix the `findIndex(...) || 0` fallback in `OperationNode` so a missing match
does not preserve an invalid index, preventing keyboard confirm and highlight
from pointing at hidden tabs.
- Around line 80-82: The search filtering in OperationNode should not rely on
String(tab.label), because ReactNode labels can stringify to “[object Object]”
and fail in the “more” search. Update the filtering logic around filteredTabs to
use visible text derived from the tab label, or add a configurable filter text
source, so tabs with element labels still match correctly. Keep the fix
localized to the tab filtering path and preserve the existing Tabs API behavior.

---

Nitpick comments:
In `@tests/overflow.test.tsx`:
- Around line 675-746: Current tests in overflow.test.tsx only cover rendering,
filtering, and onSearch in the search dropdown; add regression coverage for the
default autoClearSearchValue=true behavior and the keyboard navigation/selection
flow. Extend the existing overflow dropdown tests around getTabs, showSearch,
and the rc-tabs-dropdown input to assert that the search value clears
appropriately after selection when autoClearSearchValue is enabled. Also add key
event coverage for ArrowUp, ArrowDown, and Enter to verify the dropdown item
focus and selection path does not regress.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edab3f81-7197-4ef8-9dd1-712eb57eb981

📥 Commits

Reviewing files that changed from the base of the PR and between 926f67e and f22edac.

📒 Files selected for processing (7)
  • README.md
  • assets/dropdown.less
  • docs/demo/search-dropdown.md
  • docs/examples/search-dropdown.tsx
  • src/TabNavList/OperationNode.tsx
  • src/interface.ts
  • tests/overflow.test.tsx

Comment thread docs/examples/search-dropdown.tsx Outdated
Comment on lines +53 to +56
<Tabs
activeKey="1"
onChange={() => {}}
items={items}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

让受控搜索示例保持可切换标签。

Line 54-55 把 Tabs 固定在 activeKey="1" 且忽略 onChange,所以从搜索结果点选其他 tab 时示例不会切换内容。这里演示的是受控 searchValue,不是受控 tab 状态,建议单独维护一个 activeKey

建议修改
 const ControlledDemo = ({ items }: { items: any[] }) => {
+  const [activeKey, setActiveKey] = useState('1');
   const [searchValue, setSearchValue] = useState('');
 
   return (
     <Tabs
-      activeKey="1"
-      onChange={() => {}}
+      activeKey={activeKey}
+      onChange={setActiveKey}
       items={items}
       more={{
         showSearch: {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Tabs
activeKey="1"
onChange={() => {}}
items={items}
const ControlledDemo = ({ items }: { items: any[] }) => {
const [activeKey, setActiveKey] = useState('1');
const [searchValue, setSearchValue] = useState('');
return (
<Tabs
activeKey={activeKey}
onChange={setActiveKey}
items={items}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/search-dropdown.tsx` around lines 53 - 56, Search-dropdown 示例里的
Tabs 被固定为 activeKey="1" 且 onChange 被忽略,导致点击搜索结果切换标签无效;请在 search-dropdown.tsx 中为
Tabs 单独维护一个 activeKey 状态,并在 onChange 里更新它,让受控的 searchValue 与 tab
切换状态分离,保持示例可正常切换。

Comment thread README.md
Comment on lines +121 to +132
| more | MoreProps | - | dropdown 配置,透传 `@rc-component/dropdown` 的属性 |

### MoreProps

| name | type | default | description |
| ---------------------- | --------------------------- | ---------- | ------------------------ |
| icon | ReactNode | - | 自定义更多按钮图标 |
| showSearch | boolean \| ShowSearchConfig | - | 是否显示搜索框 |
| - placeholder | string | `'Search'` | 搜索框占位文字 |
| - searchValue | string | - | 搜索框的值(受控模式) |
| - onSearch | (value: string) => void | - | 搜索值变化回调 |
| - autoClearSearchValue | boolean | `true` | 关闭时是否自动清空搜索值 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

README 这里请保持英文文档一致性。

Line 121 到 Line 132 新增的 more / MoreProps 描述切成了中文,但这个 README 其余部分仍是英文。公开文档在 API 表格里突然切换语言会影响 npm / GitHub 读者阅读,建议统一翻成英文后再合入。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 121 - 132, The new `more` / `MoreProps` API table
entries in the README are written in Chinese while the rest of the document is
English; update these descriptions to English to keep the public documentation
language consistent. Please revise the `MoreProps` section and its nested fields
(`icon`, `showSearch`, `placeholder`, `searchValue`, `onSearch`,
`autoClearSearchValue`) so the wording matches the surrounding README style.

Comment on lines +80 to +82
const filteredTabs = mergedSearchValue
? tabs.filter(tab => String(tab.label).toLowerCase().includes(mergedSearchValue.toLowerCase()))
: tabs;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

不要用 String(tab.label) 作为搜索源。

Line 81 这里把 label 直接转成字符串,遇到 ReactNode 会变成 "[object Object]"Tabs 的公开用法本身就允许元素标签,README.md Line 63 和 Line 70 也是 <p>...</p>,所以这会让带样式的标签在 “more” 搜索里完全搜不到。这里需要提取可见文本,或者提供可配置的 filter text,而不是依赖 String(...)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/TabNavList/OperationNode.tsx` around lines 80 - 82, The search filtering
in OperationNode should not rely on String(tab.label), because ReactNode labels
can stringify to “[object Object]” and fail in the “more” search. Update the
filtering logic around filteredTabs to use visible text derived from the tab
label, or add a configurable filter text source, so tabs with element labels
still match correctly. Keep the fix localized to the tab filtering path and
preserve the existing Tabs API behavior.

Comment on lines +145 to 147
// 键盘导航只在过滤后的 tabs 上生效
const enabledTabs = filteredTabs.filter(tab => !tab.disabled);
let selectedIndex = enabledTabs.findIndex(tab => tab.key === selectedKey) || 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

过滤结果变化后要同步 selectedKey

Line 236 会在打开时无条件把 activeKey 设为 selectedKey,但 OperationNode 接到的是隐藏 tab 列表,activeKey 很可能根本不在当前结果集里。之后 Line 213 到 Line 216 的 Enter 分支仍会按这个过期 key 触发 onTabClick,而且 Line 147 的 findIndex(...) || 0 也不会兜底,因为 -1 在 JS 里是真值。结果就是:过滤把当前项排除后,键盘确认和高亮都可能落到一个根本没渲染的项上。建议在 openfilteredTabs 变化时,把 selectedKey 收敛到当前结果集里的 activeKey / 第一个未禁用项 / null

Also applies to: 206-217, 233-245

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/TabNavList/OperationNode.tsx` around lines 145 - 147, `OperationNode`
needs to keep `selectedKey` in sync with the current `filteredTabs` result set.
Update the selection logic around `enabledTabs`, the Enter handler, and the
`open`/`filteredTabs` effect so `selectedKey` is always coerced to a valid key
in the visible tabs (prefer current `activeKey`, otherwise the first enabled
tab, otherwise `null`). Also fix the `findIndex(...) || 0` fallback in
`OperationNode` so a missing match does not preserve an invalid index,
preventing keyboard confirm and highlight from pointing at hidden tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant