Skip to content

Conversation

lydell
Copy link

@lydell lydell commented Jun 1, 2025

In the debugger popup, the whole document is accidentally passed to __VirtualDom_virtualize, instead of document.body. The code happens to work anyway. However, in elm/virtual-dom#187 that results in the debugger popup being a blank page, due to the virtualization fixes in that PR.

This PR fixes this oversight, passing .body to the virtualization as intended.

elm/virtual-dom#187 still works without this PR, because I added a special case there. Basically, if (node === document) { node = document.body; }. This is so that elm/virtual-dom#187 isn’t a breaking change (installing that but not this fix in elm/browser would lead to a broken debugger). I still felt like it was worth fixing this problem in the “right” place, too.

Note to those following along: This PR is included in https://github.com/lydell/browser/tree/safe, which is part of https://github.com/lydell/elm-safe-virtual-dom.

@@ -46,7 +46,6 @@ var _Debugger_element = F4(function(impl, flagDecoder, debugMetadata, args)
function(sendToApp, initialModel)
{
var view = impl.__$view;
var title = __VirtualDom_doc.title;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable was unused. I stumbled upon it while doing the change just below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant