Skip to content

Commit

Permalink
Fix #2891: Autocomplete fix autoHighlight with VirtualScroller (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored May 14, 2022
1 parent 42eacba commit 004a395
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 004a395

Please sign in to comment.