gumshoe icon indicating copy to clipboard operation
gumshoe copied to clipboard

useLastItem() sometimes fails because item is undefined

Open FraserThompson opened this issue 4 years ago • 1 comments

I noticed a bug where in certain situations it'd break with an error. It seems to happen when searching for a string which has one result, adding another character so there are zero results, and then backspacing that character.

Anyway, it looks like the item passed to useLastItem is sometimes undefined. I'm not sure if there might be a better way to fix the root cause further up, but this at least stop its from failing.

FraserThompson avatar Aug 24 '19 03:08 FraserThompson

I am also having this problem. I am having a difficult time reproducing it in CodePen, but in my local environment it is happening on pages where the content area is shorter vertically than the navigation bar (it’s got dozens of items and is extremely tall).

image

matthewmcvickar avatar Dec 22 '19 07:12 matthewmcvickar