Skip to content

You can't render jQuery object of a canvas  #664

@jcubic

Description

@jcubic

Issue summary

jQuery Terminal is cloning the node if it's jQuery object:

                        var node;
                        if (value instanceof $.fn.init) {
                            // deep clone with events - we clone because remove
                            // from DOM will remove events from original object
                            node = value.clone(true, true);
                        } else {
                            // don't clone html nodes because it will not
                            // work for canvas or video tag
                            node = value;
                        }

And if you created a context of the canvas to draw it will be lost when rendering on the terminal.

Expected behavior

I expect to render canvas as a jQuery object

Actual behavior

You can't draw on canvas if you echo it as a jQuery object, you need to echo DOM Node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugresolvedif issue is resolved, it will be open until merge with master

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions