Improve morph support for <template> elements#49
Conversation
f5b02eb to
dc8816e
Compare
| */ | ||
| function ignoreValueOfActiveElement(possibleActiveElement, ctx) { | ||
| return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement; | ||
| return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body; |
|
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
morphChildrenmethods'newParentandoldParentvariables.That way, descendant nodes can be iterated across the
connected-disconnected boundary.