Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useLastItem() sometimes fails because item is undefined #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FraserThompson
Copy link
Contributor

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.

@matthewmcvickar
Copy link
Contributor

matthewmcvickar commented Dec 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants