这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@pavel-yagodin
Copy link

@pavel-yagodin pavel-yagodin commented Jul 6, 2020

Thanks a lot for contributing to react-autowhatever 🍻

Before submitting the Pull Request, please:

image

@pavel-yagodin pavel-yagodin changed the title Ошибка в IE11 при доступе к offsetTop Fix error in IE11 offsetTop of NULL Jul 6, 2020
Copy link
Collaborator

@pimterry pimterry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I'm not clear from this PR why this is necessary though, can you explain more?

As far as I can see, itemsContainer is set in storeItemsContainerReference, which is called (as a ref) in every render. The ensureHighlightedItemIsVisible function you've fixed here is only ever called in componentDidMount and componentDidUpdate, which should both always be called after a successful render, so that should already guarantee that itemsContainer is always set.

We could merge this PR, and that would make ensureHighlightedItemIsVisible less likely to throw an error, but given the above it seems likely that this error is appearing because of some other issue somewhere. It would be better to fix that root cause instead. It's also not clear how this is related to IE11, since there's no browser-specific behaviour anywhere there...

Can you provide any more detail about the issue, and how we can reproduce the problems you're seeing?

@pimterry
Copy link
Collaborator

Hi @pavel-yagodin, did you have any thoughts on my comment above? If this is still an issue for you, it'd be great to know more so we can get it sorted. If not, no worries, but I will close this PR in a few days.

@pimterry pimterry closed this Nov 9, 2020
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