Problem/Motivation
Error accessing property of undefined, when resizing page with a dialog opened.
caught TypeError: Cannot read properties of undefined (reading 'settings')
at HTMLDocument.resetSize (dialog.position.js?v=10.0.8:85:32)
at later (debounce.js?v=10.0.8:37:23)
Steps to reproduce
- Open a page and open a dialog: in my case, I use Layout Builder and can reproduce this problem when configuring a block in page node layout
- With the dialog opened, resize the window
- Error shows up in console
Proposed resolution
By looking into the function resetSize(event) {… }
So it looks like the events parameter passed in this function are not the same. When resizing, they can be of type resize or type drupalViewportOffsetChange (called by debounce.js).
And if event is of type drupalViewportOffsetChange, data attribute is undefined, causing the error accessing event.data.settings
Remaining tasks
None
User interface changes
N/A
API changes
N/A
Data model changes
N/A