wework / ray

Resources for building interfaces with WeWork's design system
https://ray.wework.com
Apache License 2.0
55 stars 13 forks source link

Dropdown Enhancement: Markup re-usage #261

Closed sick-sad-world closed 4 years ago

sick-sad-world commented 4 years ago

Bug with markup duplication observed at: https://ray.wework.com/components/dropdown/ Root cause: Due to frequent update of Gatsby React component and possibility that DOM element (which used as Key to differ instances) may fail, so possible multi-instantiation of specific component. (Which may lead to creating exceeding markup in case of Dropdown component). See screenshot Screen Shot 2020-01-10 at 4 27 27 PM

Component enhancement as a part of solution: Now Dropdown will check markup that needs to be added to layout, if it already been placed (by hand, or by previous instance). Added tests to check this specific case.

Test URL: https://deploy-preview-261--ray-docs.netlify.com/components/dropdown/

kconst commented 4 years ago

Thanks for the update! Looks good.