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

Created on 26 April 2023, over 1 year ago
Updated 23 July 2024, 4 days ago

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

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Javascriptย  โ†’

Last updated less than a minute ago

  • Maintained by
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @justafish
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance @nod_
Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada Robert Ngo Montreal โšœ๏ธ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024