Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292761

Error: Cannot read properties of undefined (reading 'settings')
 with dialog.position.js

$
0
0

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

  1. 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
  2. With the dialog opened, resize the window
  3. 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

Release notes snippet


Viewing all articles
Browse latest Browse all 292761

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>