-
-
Notifications
You must be signed in to change notification settings - Fork 241
feat(Tabs): support showSearch in more dropdown #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EmilyyyLiu
wants to merge
14
commits into
react-component:master
Choose a base branch
from
EmilyyyLiu:feat/add-showSearch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+489
−21
Open
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f22edac
feat(Tabs): support showSearch in more dropdown
186feeb
feat(Tabs): move ControlledDemo component to the top for better reada…
da9a598
feat(Tabs): add input support and keyboard navigation for search func…
20934ca
feat(Tabs): add tests for search value persistence and clearing on dr…
0187104
fix(OperationNode): remove click event propagation on dropdown close
d8ebc66
feat(README): update dropdown configuration descriptions and improve …
191e236
fix(Tabs.Overflow): adjust scrollIntoView implementation and update s…
644da59
feat(OperationNode): enhance search functionality with custom filter …
b2ba0b6
feat(OperationNode): add search input focus handling and refactor sea…
8ebedaa
feat(OperationNode): refactor keyboard navigation handling and improv…
fac72a5
fix(OperationNode): avoid selecting hidden tabs when filtered
11901d0
Merge branch 'master' into feat/add-showSearch
EmilyyyLiu 8775a35
feat(Tabs): add custom filter and improve showSearch functionality in…
62751a7
feat(Overflow.test): improve showSearch test for non-string labels fi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: Search Dropdown | ||
| nav: | ||
| title: Demo | ||
| path: /demo | ||
| --- | ||
|
|
||
| <code src="../examples/search-dropdown.tsx"></code> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import React, { useState } from 'react'; | ||
| import '../../assets/index.less'; | ||
| import Tabs from '../../src'; | ||
|
|
||
| // Controlled mode example | ||
| const ControlledDemo = ({ items }: { items: any[] }) => { | ||
| const [searchValue, setSearchValue] = useState(''); | ||
|
|
||
| return ( | ||
| <Tabs | ||
| activeKey="1" | ||
| onChange={() => {}} | ||
| items={items} | ||
| more={{ | ||
| showSearch: { | ||
| placeholder: 'Controlled search...', | ||
| searchValue, | ||
| onSearch: setSearchValue, | ||
| }, | ||
| }} | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| export default () => { | ||
| const [activeKey, setActiveKey] = useState('1'); | ||
|
|
||
| // Generate many tabs to trigger the "more" button | ||
| const items = Array.from({ length: 30 }, (_, i) => ({ | ||
| key: String(i + 1), | ||
| label: `Tab ${i + 1}`, | ||
| children: `Content of Tab ${i + 1}`, | ||
| })); | ||
|
|
||
| return ( | ||
| <div> | ||
| <h3>Basic Usage</h3> | ||
| <Tabs | ||
| activeKey={activeKey} | ||
| onChange={setActiveKey} | ||
| items={items} | ||
| more={{ | ||
| showSearch: { | ||
| placeholder: 'Search...', | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| <h3>Controlled Mode</h3> | ||
| <ControlledDemo items={items} /> | ||
|
|
||
| <h3>Keep Search Value on Close</h3> | ||
| <Tabs | ||
| activeKey={activeKey} | ||
| onChange={setActiveKey} | ||
| items={items} | ||
| more={{ | ||
| showSearch: { | ||
| placeholder: 'Keep search value', | ||
| autoClearSearchValue: false, | ||
| }, | ||
| }} | ||
| /> | ||
| </div> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.