@seafile/sdoc-editor 2.0.52 → 2.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -67,12 +67,21 @@ function AIModule(_ref) {
|
|
|
67
67
|
const articleDom = document.querySelector('.sdoc-editor__article');
|
|
68
68
|
articleDom.style.paddingBottom = needPaddingBottomHeight + 'px';
|
|
69
69
|
}
|
|
70
|
+
const isInView = rect.top + rect.height - window.innerHeight;
|
|
70
71
|
const heightDiff = rect.bottom + _constants.AI_MIN_HEIGHT - window.innerHeight;
|
|
71
72
|
if (heightDiff > 0) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
if (isInView < 0) {
|
|
74
|
+
scrollRef.current.scrollTo({
|
|
75
|
+
top: scrollTop + rect.top - 94,
|
|
76
|
+
behavior: 'smooth'
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
scrollRef.current.scrollTo({
|
|
80
|
+
top: scrollTop + (rect.bottom - 94) - 100,
|
|
81
|
+
// scroll top + the rect bottom with container top - shown content height
|
|
82
|
+
behavior: 'smooth'
|
|
83
|
+
});
|
|
84
|
+
}
|
|
76
85
|
}
|
|
77
86
|
setTimeout(() => {
|
|
78
87
|
var _rect, _inputRef$current;
|