@@ -14,6 +14,7 @@ import {
1414 VariableTextInputView ,
1515} from 'react-native-variable-text-input' ;
1616import { EmojiList } from './EmojiList' ;
17+ import type { IInputEmojiDataType } from './assets' ;
1718export const App = ( ) => {
1819 const inPutRef = React . createRef < IATTextViewBase > ( ) ;
1920 const [ keyBoardHeight , setKeyBoardHeight ] = useState < number > ( 0 ) ;
@@ -52,24 +53,30 @@ export const App = () => {
5253 //todo
5354 console . log ( 'onMentions===>' , data ) ;
5455 } ;
55- const onTouchEmView = ( ) => {
56- setKeyBoardHeight ( 0 ) ;
57- inPutRef . current ?. blur ( ) ;
58- } ;
56+ // const onTouchEmView = () => {
57+ // setKeyBoardHeight(0);
58+ // inPutRef.current?.blur();
59+ // };
5960 const onTouchContro = ( ) => {
6061 ! showEmoji && inPutRef . current ?. blur ( ) ;
6162 showEmoji && inPutRef . current ?. focus ( ) ;
6263 setShowEmoji ( ! showEmoji ) ;
6364 } ;
65+ const onPressText = ( ) => {
66+ inPutRef . current ?. changeAttributedText ( [ { type : 0 , text : 'eeeeeee' } ] ) ;
67+ } ;
68+ const onSelect = ( data : IInputEmojiDataType ) => {
69+ //todo
70+ inPutRef . current ?. changeAttributedText ( [
71+ { type : 0 , text : 'eeeeeee' } ,
72+ data ,
73+ ] ) ;
74+ } ;
6475 return (
6576 < View style = { styles . container } >
66- < View style = { { flex : 1 , width : '100%' } } >
67- < TouchableOpacity
68- onPress = { onTouchEmView }
69- activeOpacity = { 1 }
70- style = { { flex : 1 } }
71- />
72- </ View >
77+ < Text onPress = { onPressText } style = { { marginTop : 200 , marginBottom : 50 } } >
78+ { '测试方法' }
79+ </ Text >
7380 < View >
7481 < View style = { styles . hor } >
7582 < VariableTextInputView
@@ -109,7 +116,11 @@ export const App = () => {
109116 < Text style = { styles . sendText } > SEND</ Text >
110117 </ View >
111118 </ View >
112- < EmojiList numColumns = { 6 } keyBoardHeight = { keyBoardHeight } />
119+ < EmojiList
120+ numColumns = { 6 }
121+ keyBoardHeight = { keyBoardHeight }
122+ onSelect = { onSelect }
123+ />
113124 </ View >
114125 </ View >
115126 ) ;
@@ -118,8 +129,6 @@ export default App;
118129const styles = StyleSheet . create ( {
119130 container : {
120131 flex : 1 ,
121- alignItems : 'center' ,
122- justifyContent : 'flex-end' ,
123132 } ,
124133 box : {
125134 backgroundColor : '#000' ,
0 commit comments