primereact icon indicating copy to clipboard operation
primereact copied to clipboard

VirtualScroller: autoHighlight doesn't work

Open AvadhananamVamsiKrishna opened this issue 2 years ago • 12 comments

Describe the bug

When I use autoHighlight in AutoComplete which has virtualScrollerOptions, It doesn't work. The first item in the list is not getting highlighted. When I removed the virtualScrollerOptions property then autoHighlight was working properly.

Reproducer

https://codesandbox.io/s/primereact-demo-forked-d0w3y5?file=/src/App.js

PrimeReact version

^9.2.2

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Open this PrimeReact Autocomplete official basic demo code sandbox link: https://codesandbox.io/s/eyny49
  2. Add the below attributes to the autocomplete:
  • autoHighlight={true}
  • virtualScrollerOptions={{ itemSize: 38 }}
  1. Just save and refresh the output window
  2. You will be able to see the option doesn't get highlighted

Expected behavior

The first item in the dropdown list should get highlighted when we use autoHighlight with virtualScrollerOptions in Autocomplete

AvadhananamVamsiKrishna avatar Apr 04 '23 10:04 AvadhananamVamsiKrishna

Hmm this was fixed previously so something has changed: https://github.com/primefaces/primereact/issues/2891

melloware avatar Apr 04 '23 11:04 melloware

May I know when this will be fixed?

vamsiravada avatar May 10 '23 09:05 vamsiravada

@vamsiravada unless a community member donates a PR.

Or if you have PRO support you can request this be fixed through your PRO account.

melloware avatar May 10 '23 10:05 melloware

I am pretty sure #4536 fixed this by @userkks

melloware avatar Jul 13 '23 23:07 melloware

It's still reproducing @melloware

vamsiravada avatar Aug 16 '23 11:08 vamsiravada

Yes the Milestone on the right says "10.0.0" which is not released yet. So this bug is fixed but not published.

melloware avatar Aug 16 '23 12:08 melloware

This still doesn't work in 10.0.2. See this example I forked from the Virtual Scroll example in the documentation and just added autoHighlight: https://stackblitz.com/edit/react-jqhgpu?file=src%2FApp.js

Frdnspnzr avatar Oct 06 '23 08:10 Frdnspnzr

@userkks want to look at this one I thought your fix for the other fixed this but it seems broken still?

melloware avatar Oct 06 '23 12:10 melloware

I didn't fix it but I did stop the crashing that it couldn't find element.current but the core issue still remains

melloware avatar Oct 06 '23 13:10 melloware

@melloware checking on it

userkks avatar Oct 08 '23 04:10 userkks

Anything new here?

sasa0103 avatar Mar 06 '24 06:03 sasa0103

@sasa0103 if you need immediate support I suggest you look into PrimeReact PRO Support: https://primereact.org/support/

melloware avatar Mar 06 '24 13:03 melloware

I just tried it again and it's working again since at least 10.6.3.

Frdnspnzr avatar Sep 06 '24 09:09 Frdnspnzr