react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

@react-stately/data : Cannot read properties of undefined (reading 'index') at useListState.ts

Open Develekko opened this issue 1 year ago โ€ข 5 comments

Provide a general summary of the issue here

there's an issue on useListState.ts of @react-stately where im getting this error TypeError: Cannot read properties of undefined (reading 'index') at useListState.ts line:77

๐Ÿค” Expected Behavior?

no errors

๐Ÿ˜ฏ Current Behavior

im getting this error TypeError: Cannot read properties of undefined (reading 'index') at useListState.ts

๐Ÿ’ Possible Solution

  let index = Math.min(
    (
      diff > 1 ?
      Math.max(startItem?.index - diff + 1, 0) :
      startItem?.index
    ),
    itemNodes.length - 1);

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

  let index = Math.min(
    (
      diff > 1 ?
      Math.max(startItem?.index - diff + 1, 0) :
      startItem?.index
    ),
    itemNodes.length - 1);

Version

@react-stately/data v 3.11.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

windows

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

Develekko avatar Feb 06 '24 13:02 Develekko

I'm also having this issue

jsonMartin avatar Feb 09 '24 06:02 jsonMartin

same issue !

mayvagio2016 avatar Apr 01 '24 10:04 mayvagio2016

Does anyone have a reproduction that they can share? I'd like a test for this change if possible

snowystinger avatar Apr 02 '24 00:04 snowystinger

Hi, we also having the same issue. https://github.com/Kong/insomnia/issues/7149. I found this error occurs from here through the error message and source code.

CurryYangxx avatar Apr 09 '24 11:04 CurryYangxx

Same issue here!

slimshreydy avatar Jun 24 '24 01:06 slimshreydy