File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,15 @@ class VirtualKeyboard extends Component {
180180 [ ( ) => keyDown ( "custom" ) , null , ( ) => keyDown ( "back" ) ]
181181 ] ;
182182
183- // Decide if the element passed as the key is text
184- const keyJsx = keyboardFuncSet [ row ] [ column ] ? (
185- < Image style = { [ keyImageDefaultStyle , keyImageStyle ] } source = { entity } />
186- ) : (
187- < Text style = { [ keyTextDefaultStyle , keyTextStyle ] } > { entity } </ Text >
188- ) ;
183+ // Decide what type of element is passed as the key
184+ let keyJsx ;
185+ if ( React . isValidElement ( entity ) ) {
186+ keyJsx = entity ;
187+ } else if ( keyboardFuncSet [ row ] [ column ] ) {
188+ keyJsx = < Image style = { [ keyImageDefaultStyle , keyImageStyle ] } source = { entity } /> ;
189+ } else {
190+ keyJsx = < Text style = { [ keyTextDefaultStyle , keyTextStyle ] } > { entity } </ Text > ;
191+ }
189192
190193 // We want to block keyboard interactions if it has been disabled.
191194 if ( ! disabled ) {
You can’t perform that action at this time.
0 commit comments