@streamsai/ui 0.1.7 → 0.1.8
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.
|
@@ -1004,7 +1004,23 @@ function TypeaheadMenuAboveCaret({ anchor, dataAttr, className, children, option
|
|
|
1004
1004
|
// Lexical writes top/left on the absolute anchor when the caret moves.
|
|
1005
1005
|
const observer = new MutationObserver(update);
|
|
1006
1006
|
observer.observe(anchor, { attributes: true, attributeFilter: ['style'] });
|
|
1007
|
+
// The iOS app lifts the composer on the keyboard's curve by tweening its padding in JS: the
|
|
1008
|
+
// editor moves frame by frame with no viewport, scroll, selection or resize event to follow.
|
|
1009
|
+
// A menu opened with the keyboard down stayed where the composer used to be, on top of it.
|
|
1010
|
+
const editorRoot = editor.getRootElement();
|
|
1011
|
+
let editorTop = editorRoot?.getBoundingClientRect().top;
|
|
1012
|
+
let watchRaf = 0;
|
|
1013
|
+
const watchEditor = () => {
|
|
1014
|
+
const top = editorRoot?.getBoundingClientRect().top;
|
|
1015
|
+
if (top !== editorTop) {
|
|
1016
|
+
editorTop = top;
|
|
1017
|
+
update();
|
|
1018
|
+
}
|
|
1019
|
+
watchRaf = window.requestAnimationFrame(watchEditor);
|
|
1020
|
+
};
|
|
1021
|
+
watchRaf = window.requestAnimationFrame(watchEditor);
|
|
1007
1022
|
return () => {
|
|
1023
|
+
window.cancelAnimationFrame(watchRaf);
|
|
1008
1024
|
if (rafRef.current != null)
|
|
1009
1025
|
window.cancelAnimationFrame(rafRef.current);
|
|
1010
1026
|
rafRef.current = null;
|
package/package.json
CHANGED