Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcubic opened this issue May 23, 2021 · 0 comments
Closed

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

jcubic opened this issue May 23, 2021 · 0 comments
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented May 23, 2021

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.

@jcubic jcubic added the Bug label May 23, 2021
@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label May 31, 2021
@jcubic jcubic closed this as completed May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant