From 4f5a87c7f15bf0b24f4f948a6a7127af54bca62e Mon Sep 17 00:00:00 2001 From: mym0404 Date: Thu, 21 Jan 2021 15:04:50 +0900 Subject: [PATCH] Ignore iPad floating keyboard frame change event --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 09c1806..2bf17c1 100644 --- a/index.js +++ b/index.js @@ -172,7 +172,9 @@ export default class ModalBox extends React.PureComponent { const keyboardFrame = evt.endCoordinates; const keyboardHeight = this.state.containerHeight - keyboardFrame.screenY; - this.setState({keyboardOffset: keyboardHeight}, () => { + const isFloatingKeyboard = Dimensions.get('window').width !== keyboardFrame.width; + + this.setState({keyboardOffset: isFloatingKeyboard ? 0 : keyboardHeight}, () => { this.animateOpen(); }); }