Skip to content

Commit

Permalink
Fix primefaces#2891: Autocomplete fix autoHighlight with VirtualScroller
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed May 14, 2022
1 parent 7121122 commit 4b2ea29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/autocomplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export const AutoComplete = React.memo(React.forwardRef((props, ref) => {

const onOverlayEntering = () => {
if (props.autoHighlight && props.suggestions && props.suggestions.length) {
DomHandler.addClass(overlayRef.current.firstChild.firstChild, 'p-highlight');
let element = overlayRef.current.firstChild;
element = props.virtualScrollerOptions ? element.firstChild.firstChild : element.firstChild;
DomHandler.addClass(element, 'p-highlight');
}
}

Expand Down

0 comments on commit 4b2ea29

Please sign in to comment.