Replies: 5 comments 5 replies
-
The workarounds you describe would be the solution as today. I understand that making an html element pixles, freezes it, so no hover effects, no click feedback, nothing. |
Beta Was this translation helpful? Give feedback.
-
Just to preempt what will likely be some common questions with this functionality, HTMLObjects will not have all of the same capabilities as current fabric objects. Since this new class would only be anchored to the DOM and not drawn to the canvas itself, a few notable limitations come to mind. No Rasterization Stacking Limitations Which brings me to the final issue... Serialization XSS Concerns |
Beta Was this translation helpful? Give feedback.
-
Use case for needing actual HTML
css clipping POCYou can see the math editor which is HTML and the selected fabric object clipping it while moving
Note as well this will also mean no reading color data from specific pixel coordinates, so therefore things like eyedroppers won't work. @melchiar valid point. I don't know how the native eyedroppers work or if we can access them (quite sure we can't). Cause if there is some option we can add logic to handle this from within fabric.
I think that stacking in the essence of the spec. That's what I really need when I try to integrate it into a fabric app. Without it I remain with toolbars and I don't see what the impl does.
I am not knowledgeable in security risks. However, passing HTML elements poses no issues, same as Image receives a HTMLImageElement or video. fabric should not handle any HTML tasks. The maximum it should do is |
Beta Was this translation helpful? Give feedback.
-
I thought of this a day ago and I came up with something interesting. |
Beta Was this translation helpful? Give feedback.
-
@ShaMan123 sorry for bumping late to the party, sounds amazing, I need to represent alot of html elements inside the canvas, for now im rendering it to an image but any other solution would be better lol |
Beta Was this translation helpful? Give feedback.
-
Overview
This is a tracking discussion for implementing a way to handle HTML with fabric.
Many devs want this feature, myself included.
We will try to define a spec of what this object does. It's purpose is to make the HTML element look and feel as if it is part of the canvas.
There are simple use cases that the best practice towards solving them would be using a Control as an anchor to the HTML object, e.g. dropdown toolbar.
However there are cases where this is insufficient:
Spec
clip-path
css to clip the HTML element with all the objects on top of in the object stack produced a promising POCWorkarounds
Beta Was this translation helpful? Give feedback.
All reactions