Skip to content

"Unspecified error." when trying to copy a table in IE11 (workaround included). #93

@Poryhack

Description

@Poryhack

The following example will fail to copy in IE11 and the text "Unspecified error." will show up in the console.

    <!-- Trigger -->
    <button class="btn clipboard-button" data-clipboard-target="#foo">Copy!</button>

    <!-- Target -->
    <div>
        <table id="foo">
            <tr>
                <th>First name</th>
                <th>Last name</th>
            </tr>
            <tr>
                <td>John</td>
                <td>Doe</td>
            </tr>
            <tr>
                <td>Jane</td>
                <td>Doe</td>
            </tr>
        </table>
    </div>

However if the target element is a div wrapping the desired table, all works well.

    <!-- Trigger -->
    <button class="btn clipboard-button" data-clipboard-target="#foo">Copy!</button>

    <!-- Target -->
    <div id="foo">
        <table>
            <tr>
                <th>First name</th>
                <th>Last name</th>
            </tr>
            <tr>
                <td>John</td>
                <td>Doe</td>
            </tr>
            <tr>
                <td>Jane</td>
                <td>Doe</td>
            </tr>
        </table>
    </div>

Specifics: IE11 version 11.0.9600.18015 running in edge mode on Windows 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions