Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
I noticed this problem first with Views.
Steps to reproduce
- Open the default content View.
- Click the Add field button.
- Pick a field from the checkbox list.
- Click the apply button. The dialog refreshes with a the second step in a multiform.
- Resize the window.
- A JavaScript error is thrown.
I believe this has to do with the way we're debouncing the resize function in dialog.position.js. The eventData params associated with the event handler are not getting passed through to the handler function after the dialog is re-opened on when it refreshes with the new form. If I take the debounce off the handler, the error disappears. I'm investigating how we can debounce the function and not raise an error.
Proposed resolution
Fix it.
Remaining tasks
Fix it.
User interface changes
None.
API changes
None.
Related Issues
#1851414: Convert Views to use the abstracted dialog modal
Original report by @jessebeach
Comment | File | Size | Author |
---|---|---|---|
#1 | 2114475-1-dialog-resize-error.patch | 4.07 KB | jessebeach |
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedRather than using jQuery's event data, I've curried the event data to the resize function and then debounced that. This keeps the data associated with the callback correctly.
Also, we weren't removing the
drupalViewportOffsetChange
event handler on thedocument
when tearing down the dialog. This caused an error when this event fired.Since Views will create a new dialog without tearing down the old one in a multistep form, I've removed the event handlers in the
dialog:aftercreate
callback on thewindow
anddocument
before binding new ones.Comment #2
Wim LeersI cannot reproduce the original problem. Which browser did that happen in?
Comment #3
jessebeach CreditAttribution: jessebeach commentedI can no longer reproduce this error either. I'm closing as cannot reproduce.