Skip to content

tooltip source:auto cloned content causes issues with pat-inject #394

Open
@adrianwhite

Description

@adrianwhite

This causes issues when pat-inject tries and update the tooltip content.
I'm not sure of the best way to create an example of this issue.

I have markup similar to:

<a href="#my-item-wrapper" class="pat-tooltip" data-pat-tooltip="source:auto">I have a tooltip</a>

<div id="my-item-wrapper" style="display:none;">
<div id="my-item">
    <form id="my-search-form"
           action="/url-to-search-results"
           class="pat-inject"
           data-pat-inject="target: #my-search-results; source: #search-results">
        <input name="" type="search" placeholder="Search" />
        <button type="submit">Search</button>
    </form>
    <div id="my-search-results">
        <!-- results go here -->
    </div>
</div>

pat-tooltip takes the content of div#my-item-wrapper and clones it into a tooltip.
The issue is that I end up with two copies of div#my-item and all contents including div#my-search-results. This means that pat-inject injects the results of the search into the first div#my-search-results it finds, which is the original one not the one in the tooltip.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions