segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

Wrap update in function to prevent event from being passed as value #1612

Closed brandongregoryscott closed 1 year ago

brandongregoryscott commented 1 year ago

Overview

Resolves #1556 - the event from resize and scroll events was being passed as the first parameter to update, which would cause a NaN error. Since we're not using the event for anything (just looking to recalculate the position when scrolling or resizing the window), I wrapped the update call in a function.

Tested using the minimal reproduction code linked in the issue.

Screenshots (if applicable)

Documentation

netlify[bot] commented 1 year ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit 8c6cd3f47fb81407ac1a1cf7e9936a89652d8f28
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/63e170fa94c65b0009719c39
Deploy Preview https://deploy-preview-1612--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.