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' ;
@@ -91,7 +90,6 @@ type State = {|
91
90
isMenuExpanded : boolean ,
92
91
topic : string ,
93
92
message : string ,
94
- height : number ,
95
93
selection : InputSelection ,
96
94
| } ;
97
95
@@ -148,7 +146,6 @@ class ComposeBox extends PureComponent<Props, State> {
148
146
isTopicFocused : false ,
149
147
isFocused : false ,
150
148
isMenuExpanded : false ,
151
- height : 20 ,
152
149
topic :
153
150
this . props . initialTopic !== undefined
154
151
? this . props . initialTopic
@@ -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
} ;
@@ -352,7 +343,7 @@ class ComposeBox extends PureComponent<Props, State> {
352
343
} ,
353
344
autocompleteWrapper : {
354
345
position : 'absolute' ,
355
- bottom : 0 ,
346
+ bottom : '100%' ,
356
347
width : '100%' ,
357
348
} ,
358
349
composeBox : {
@@ -383,7 +374,7 @@ class ComposeBox extends PureComponent<Props, State> {
383
374
} ;
384
375
385
376
render ( ) {
386
- const { isTopicFocused , isMenuExpanded , height , message , topic , selection } = this . state ;
377
+ const { isTopicFocused , isMenuExpanded , message , topic , selection } = this . state ;
387
378
const {
388
379
ownUserId,
389
380
narrow,
@@ -419,7 +410,7 @@ class ComposeBox extends PureComponent<Props, State> {
419
410
`MentionWarnings` should use a type-checked `connect`
420
411
*/ }
421
412
< MentionWarnings narrow = { narrow } stream = { stream } ref = { this . mentionWarnings } />
422
- < View style = { [ this . styles . autocompleteWrapper , { marginBottom : height } ] } >
413
+ < View style = { [ this . styles . autocompleteWrapper ] } >
423
414
< TopicAutocomplete
424
415
isFocused = { isTopicFocused }
425
416
narrow = { narrow }
@@ -433,7 +424,7 @@ class ComposeBox extends PureComponent<Props, State> {
433
424
onAutocomplete = { this . handleMessageAutocomplete }
434
425
/>
435
426
</ View >
436
- < View style = { [ this . styles . composeBox , style ] } onLayout = { this . handleLayoutChange } >
427
+ < View style = { [ this . styles . composeBox , style ] } >
437
428
< ComposeMenu
438
429
destinationNarrow = { this . getDestinationNarrow ( ) }
439
430
expanded = { isMenuExpanded }
0 commit comments