Fix InputAccessoryView safe area when not attached to a TextInput (#21179)

Summary:
When using an InputAccessoryView attached to a TextInput the safe area insets are not applied properly. This uses different autolayout constraints that works in all cases I tested, roughly based on the technique used here https://github.com/stockx/SafeAreaInputAccessoryViewWrapperView/blob/master/SafeAreaInputAccessoryViewWrapperView/Classes/SafeAreaInputAccessoryViewWrapperView.swift#L38.
Pull Request resolved: https://github.com/facebook/react-native/pull/21179

Differential Revision: D9928503

Pulled By: hramos

fbshipit-source-id: b1b623334558093042fd94ac85e1b52dd16aa1a0
This commit is contained in:
Janic Duplessis
2018-09-18 18:23:55 -07:00
committed by Facebook Github Bot
parent a0f7d6090f
commit 2191eecf54
3 changed files with 47 additions and 20 deletions

View File

@@ -42,7 +42,7 @@
- (void)reactSetFrame:(CGRect)frame
{
[_inputAccessoryView setFrame:frame];
[_inputAccessoryView reactSetFrame:frame];
if (_shouldBecomeFirstResponder) {
_shouldBecomeFirstResponder = NO;