Skip to content

Commit d97bf85

Browse files
committed
Fix: wrong order of removing old highlight.
1 parent abb2de0 commit d97bf85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/components/editors/linked/UIEditorLinked.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,13 @@ const UIEditorLinked: FC<IEditorLinked & IExtendableLinkedEditor & IComponentCon
664664
setTimeout(() => {
665665
const el = linkedRef.current?.getOverlay()?.querySelectorAll('.p-autocomplete-item')[index - virtualscroller.getRenderedRange().first];
666666
if (el) {
667-
el.classList.add('p-highlight');
668-
el.setAttribute('data-p-highlight', 'true');
669667
const oldEl = linkedRef.current?.getOverlay()?.querySelector('.p-autocomplete-item.p-highlight');
670668
if (oldEl) {
671669
oldEl.classList.remove('p-highlight');
672670
oldEl.removeAttribute('data-p-highlight');
673671
}
672+
el.classList.add('p-highlight');
673+
el.setAttribute('data-p-highlight', 'true');
674674
}
675675
alignOverlay(true);
676676
}, 50);

0 commit comments

Comments
 (0)