@@ -52,6 +52,7 @@ import { AppContextType } from "../../../contexts/AppProvider";
5252import { ICellEditorDate } from "../date/UIEditorDate" ;
5353import useAppContext from "../../../hooks/app-hooks/useAppContext" ;
5454import { VirtualScroller } from "primereact/virtualscroller" ;
55+ import { DomHandler } from "primereact/utils" ;
5556
5657interface ReferencedColumnNames {
5758 columnNames : string [ ]
@@ -876,7 +877,7 @@ const UIEditorLinked: FC<IEditorLinked & IExtendableLinkedEditor & IComponentCon
876877
877878 // Handles the lazy-load, if the linked is at the end but not every row is fetched, it fetches 100 new rows
878879 const handleLazyLoad = ( event :any ) => {
879- if ( event . last >= providedData . length && ! props . context . contentStore . getDataBook ( props . screenName , props . cellEditor . linkReference . referencedDataBook || "" ) ?. isAllFetched ) {
880+ if ( event . last >= providedData . length && ! props . context . contentStore . getDataBook ( props . screenName , props . cellEditor . linkReference . referencedDataBook || "" ) ?. isAllFetched ) {
880881 const fetchReq = createFetchRequest ( ) ;
881882 fetchReq . dataProvider = props . cellEditor . linkReference . referencedDataBook ;
882883 fetchReq . fromRow = providedData . length ;
@@ -1011,6 +1012,16 @@ const UIEditorLinked: FC<IEditorLinked & IExtendableLinkedEditor & IComponentCon
10111012 }
10121013 } , [ linkedRef ] ) ;
10131014
1015+ const alignOverlay = useCallback ( ( ) => {
1016+ if ( linkedRef . current ) {
1017+ DomHandler . alignOverlay (
1018+ linkedRef . current . getOverlay ( ) ,
1019+ linkedRef . current . getInput ( ) as any ,
1020+ document . body as any
1021+ ) ;
1022+ }
1023+ } , [ ] )
1024+
10141025 return (
10151026 < span
10161027 ref = { props . forwardedRef }
@@ -1134,12 +1145,15 @@ const UIEditorLinked: FC<IEditorLinked & IExtendableLinkedEditor & IComponentCon
11341145 } , 50 ) ;
11351146 }
11361147 }
1148+
1149+ alignOverlay ( ) ;
11371150 } }
11381151 virtualScrollerOptions = { {
11391152 itemSize : 38 ,
11401153 lazy : true ,
11411154 scrollHeight : suggestions ?. length ? `${ Math . min ( 6.66 , ( suggestions [ 0 ] . items ?. length ?? ( suggestions . length - 1 ) ) + 1 ) * 38 } px` : undefined ,
1142- onLazyLoad : handleLazyLoad ,
1155+ onLazyLoad : handleLazyLoad ,
1156+ onScroll : alignOverlay ,
11431157 className : props . isCellEditor
11441158 ? "celleditor-dropdown-virtual-scroller"
11451159 : "dropdown-virtual-scroller"
0 commit comments