zhangchao 5 年 前
コミット
8cc93af53b
共有2 個のファイルを変更した4 個の追加4 個の削除を含む
  1. 2
    1
      src/RichTextEditor.js
  2. 2
    3
      src/editor.html

+ 2
- 1
src/RichTextEditor.js ファイルの表示

81
   setEditorAvailableHeightBasedOnKeyboardHeight(keyboardHeight) {
81
   setEditorAvailableHeightBasedOnKeyboardHeight(keyboardHeight) {
82
     const {top = 0, bottom = 0} = this.props.contentInset;
82
     const {top = 0, bottom = 0} = this.props.contentInset;
83
     const {marginTop = 0, marginBottom = 0} = this.props.style;
83
     const {marginTop = 0, marginBottom = 0} = this.props.style;
84
+    const {heightToScreenTop = 0} = this.props;
84
     const spacing = marginTop + marginBottom + top + bottom;
85
     const spacing = marginTop + marginBottom + top + bottom;
85
 
86
 
86
-    const editorAvailableHeight = Dimensions.get('window').height - keyboardHeight - spacing;
87
+    const editorAvailableHeight = Dimensions.get('window').height - keyboardHeight - spacing - heightToScreenTop;
87
     this.setEditorHeight(editorAvailableHeight);
88
     this.setEditorHeight(editorAvailableHeight);
88
   }
89
   }
89
 
90
 

+ 2
- 3
src/editor.html ファイルの表示

964
 			}
964
 			}
965
 
965
 
966
 			zss_editor.updateOffset = function() {
966
 			zss_editor.updateOffset = function() {
967
-
968
 				if (!zss_editor.updateScrollOffset)
967
 				if (!zss_editor.updateScrollOffset)
969
 					return;
968
 					return;
970
 
969
 
1048
 				var futureEditorHeight = caretYPosition + lineHeight;
1047
 				var futureEditorHeight = caretYPosition + lineHeight;
1049
 				if (caretYPosition < offsetY) {
1048
 				if (caretYPosition < offsetY) {
1050
 					newPos = caretYPosition;
1049
 					newPos = caretYPosition;
1051
-				} else if (futureEditorHeight > editorHeight + offsetY) {
1052
-					newPos = futureEditorHeight - editorHeight + halfLineHeight;
1050
+				} else if (futureEditorHeight > parseInt(editorHeight) + offsetY) {
1051
+					newPos = futureEditorHeight - parseInt(editorHeight) + halfLineHeight;
1053
 				}
1052
 				}
1054
 
1053
 
1055
 				if (newPos) {
1054
 				if (newPos) {