1
1
/* @flow strict-local */
2
2
import React , { PureComponent } from 'react' ;
3
3
import { Platform , View , findNodeHandle } from 'react-native' ;
4
- import type { LayoutEvent } from 'react-native/Libraries/Types/CoreEventTypes' ;
5
4
import TextInputReset from 'react-native-text-input-reset' ;
6
5
import { type EdgeInsets } from 'react-native-safe-area-context' ;
7
6
import { compose } from 'redux' ;
@@ -93,7 +92,6 @@ type State = {|
93
92
isMenuExpanded : boolean ,
94
93
topic : string ,
95
94
message : string ,
96
- height : number ,
97
95
selection : InputSelection ,
98
96
| } ;
99
97
@@ -153,7 +151,6 @@ class ComposeBox extends PureComponent<Props, State> {
153
151
isTopicFocused : false ,
154
152
isFocused : false ,
155
153
isMenuExpanded : false ,
156
- height : 20 ,
157
154
topic : this . props . defaultTopic || '' ,
158
155
message : this . props . defaultMessage || '' ,
159
156
selection : { start : 0 , end : 0 } ,
@@ -225,12 +222,6 @@ class ComposeBox extends PureComponent<Props, State> {
225
222
} ) ) ;
226
223
} ;
227
224
228
- handleLayoutChange = ( event : LayoutEvent ) = > {
229
- this . setState ( {
230
- height : event . nativeEvent . layout . height ,
231
- } ) ;
232
- } ;
233
-
234
225
handleTopicChange = ( topic : string ) = > {
235
226
this . setState ( { topic, isMenuExpanded : false } ) ;
236
227
} ;
@@ -355,7 +346,7 @@ class ComposeBox extends PureComponent<Props, State> {
355
346
} ,
356
347
autocompleteWrapper : {
357
348
position : 'absolute' ,
358
- bottom : 0 ,
349
+ bottom : '100%' ,
359
350
width : '100%' ,
360
351
} ,
361
352
composeBox : {
@@ -386,7 +377,7 @@ class ComposeBox extends PureComponent<Props, State> {
386
377
} ;
387
378
388
379
render ( ) {
389
- const { isTopicFocused , isMenuExpanded , height , message , topic , selection } = this . state ;
380
+ const { isTopicFocused , isMenuExpanded , message , topic , selection } = this . state ;
390
381
const {
391
382
ownUserId,
392
383
narrow,
@@ -422,7 +413,7 @@ class ComposeBox extends PureComponent<Props, State> {
422
413
`MentionWarnings` should use a type-checked `connect`
423
414
*/ }
424
415
< MentionWarnings narrow = { narrow } stream = { stream } ref = { this . mentionWarnings } />
425
- < View style = { [ this . styles . autocompleteWrapper , { marginBottom : height } ] } >
416
+ < View style = { [ this . styles . autocompleteWrapper ] } >
426
417
< TopicAutocomplete
427
418
isFocused = { isTopicFocused }
428
419
narrow = { narrow }
@@ -436,7 +427,7 @@ class ComposeBox extends PureComponent<Props, State> {
436
427
onAutocomplete = { this . handleMessageAutocomplete }
437
428
/>
438
429
</ View >
439
- < View style = { [ this . styles . composeBox , style ] } onLayout = { this . handleLayoutChange } >
430
+ < View style = { [ this . styles . composeBox , style ] } >
440
431
< ComposeMenu
441
432
destinationNarrow = { this . getDestinationNarrow ( ) }
442
433
expanded = { isMenuExpanded }
0 commit comments