-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve morph support for <template>
elements
#49
Conversation
f5b02eb
to
dc8816e
Compare
dist/idiomorph.js
Outdated
@@ -110,7 +110,7 @@ var Idiomorph = (function () { | |||
* @returns {boolean} | |||
*/ | |||
function ignoreValueOfActiveElement(possibleActiveElement, ctx) { | |||
return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement; | |||
return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be very helpful to me. Right now I need to use a stimulus controller to copy the template contents on |
@1cg are you able to review these changes? The crucial part of this diff is in the According to #25 (comment), I believe those changes would be covered by your process prior to cutting a new release:
If that's a requirement for this diff, I'm happy to exclude |
hi @seanpdoyle this looks good to me, happy to merge can I ask you to revert the changes to |
Closes [bigskysoftware#15][] When morphing `<template>` elements, treat the [DocumentFragment][] instances returned from the [HTMLTemplateElement.content][] properties as `morphChildren` methods' `newParent` and `oldParent` variables. That way, descendant nodes can be iterated across the connected-disconnected boundary. [bigskysoftware#15]: bigskysoftware#15 [DocumentFragment]: https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment [HTMLTemplateElement.content]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement/content
dc8816e
to
a530659
Compare
@1cg thank you for the review. I've reverted the changes to |
Closes #15
When morphing
<template>
elements, treat the DocumentFragmentinstances returned from the HTMLTemplateElement.content properties
as
morphChildren
methods'newParent
andoldParent
variables.That way, descendant nodes can be iterated across the
connected-disconnected boundary.