-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add UnstableContext * chore: clean up * docs: fix lint * docs: fix lint
- Loading branch information
Showing
6 changed files
with
71 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,28 +1,29 @@ | ||
import React from 'react'; | ||
import Mentions from '@rc-component/mentions'; | ||
import Mentions, { UnstableContext } from '@rc-component/mentions'; | ||
import '../../assets/index.less'; | ||
|
||
export default () => ( | ||
<Mentions | ||
rows={3} | ||
defaultValue="Hello @ World @" | ||
onScroll={e => { | ||
console.log(e); | ||
}} | ||
open | ||
options={[ | ||
{ | ||
value: 'light', | ||
label: 'Light', | ||
}, | ||
{ | ||
value: 'bamboo', | ||
label: 'Bamboo', | ||
}, | ||
{ | ||
value: 'cat', | ||
label: 'Cat', | ||
}, | ||
]} | ||
/> | ||
<UnstableContext.Provider value={{ open: true }}> | ||
<Mentions | ||
rows={3} | ||
defaultValue="Hello @ World @" | ||
onScroll={e => { | ||
console.log(e); | ||
}} | ||
options={[ | ||
{ | ||
value: 'light', | ||
label: 'Light', | ||
}, | ||
{ | ||
value: 'bamboo', | ||
label: 'Bamboo', | ||
}, | ||
{ | ||
value: 'cat', | ||
label: 'Cat', | ||
}, | ||
]} | ||
/> | ||
</UnstableContext.Provider> | ||
); |
This file contains 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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import React from 'react'; | ||
import Mentions from '@rc-component/mentions'; | ||
import Mentions, { UnstableContext } from '@rc-component/mentions'; | ||
import '../../assets/index.less'; | ||
import './onScroll.less'; | ||
|
||
export default () => ( | ||
<Mentions | ||
rows={3} | ||
defaultValue="Hello @ World @" | ||
onPopupScroll={console.log} | ||
popupClassName="on-scroll" | ||
open | ||
options={Array.from({ length: 1000 }).map((_, index) => ({ | ||
value: `item-${index}`, | ||
label: `item-${index}`, | ||
}))} | ||
/> | ||
<UnstableContext.Provider value={{ open: true }}> | ||
<Mentions | ||
rows={3} | ||
defaultValue="Hello @ World @" | ||
onPopupScroll={console.log} | ||
popupClassName="on-scroll" | ||
options={Array.from({ length: 1000 }).map((_, index) => ({ | ||
value: `item-${index}`, | ||
label: `item-${index}`, | ||
}))} | ||
/> | ||
</UnstableContext.Provider> | ||
); |
This file contains 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 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 @@ | ||
import * as React from 'react'; | ||
|
||
export interface UnstableContextProps { | ||
/** Only used for antd site v6 preview usage. */ | ||
open?: boolean; | ||
} | ||
|
||
export const UnstableContext = React.createContext<UnstableContextProps>({}); |
This file contains 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 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