Closed lorenwest closed 1 year ago
We are also running into this issue when sorting for in a node/React Native environment.
Thank you very much for an exhaustive description of the problem! I use Safari myself, but the latest version.
I added a fallback to Object.prototype.hasOwnProperty
, according to the description of Object.hasOwn
at MDN.
The fix got released as 1.1.1.
When running Storybook with storybook-multilevel-sort on a Safari v14 browser, the error at the bottom of this post is shown.
The issue is simple - Safari v14 doesn't have an object.hasOwn() method.
It's pretty easy to workaround by adding the following polyfill before loading storybook-multilevel-sort
The solution is to use Object.hasOwnProperty() instead of Object.hasOwn() in the following code https://github.com/prantlf/storybook-multilevel-sort/blob/d94e8036246ff4e90a290c7cd4aea03c52273471/lib/index.js#L3
I'd be happy to have the code authors make this change, or I could issue a pull request. The fix doesn't appear to cause any backward compatibility issues.
Here's the full text of the error in case someone lands on this issue from a search. Also attached a screen shot of how this looks on a Safari v14 browser.