Skip to content

enabling morph ext breaks isInlineSwap for the hx-swap-oob="innerHTML" cases (Potential fix included) #148

Description

@y2kbugger
   htmx.defineExtension("morph", {
     isInlineSwap: function (swapStyle) {
       let config = createMorphConfig(swapStyle);
-      return config?.morphStyle === "outerHTML" || config?.morphStyle == null;
+      if (!config) return false;
+      return config.morphStyle === "outerHTML" || config.morphStyle == null;
     },
     handleSwap: function (swapStyle, target, fragment) {
       let config = createMorphConfig(swapStyle);

Causes it to incorrectly nest the entire outerHTML into the innerHTML instead of only swapping the inner for inner

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions