Dataviews: Pattern previews throw an error when changing sort order #64863
Open
Description
Description
This may also be reproducible with templates/pages, but I generally don't have enough to trigger in pagination.
Step-by-step reproduction instructions
- Open the site editor
- Open patterns (and have the category set to All Patterns)
- Change the Sort Order to ascending
- Notice that some of the patterns (possibly the ones that weren't shown prior to changing the sort order?) shown an error and the browser console logs:
index.js:145 Uncaught TypeError: Cannot destructure property 'documentElement' of 'contentDocument' as it is null.
at HTMLIFrameElement.onLoad (index.js:145:12)
This also seems worse when changing the Items Per Page to 100 prior to changing the sort order.
Another observation is that when the Patterns page loads the first time it has a random sort order (I guess whatever's returned by the REST API, possibly creation order?). You can change the sort order to alphabetical, but then there's no way to go back other than reloading the page. It makes me wonder what the purpose of the initial sort order is.
Screenshots, screen recording, code snippet
Environment info
Mac OS / Brave
Reproduced on latest trunk
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes