-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ForeignObject - not showing form element #1058
Comments
Hm thats strange. When you edit the html, it suddenly shows up. So that has to be a problem with namespaces i guess. So I think this is a bug. But I need to dig deeper for this. // EDIT: tried it myself - that works |
Thanks for the very fast reply! :) var draw = SVG().addTo('body').size(400, 400);
var forObj = draw.foreignObject(200, 200);
//var text = SVG('<textarea>Foo example</textarea>'); // removed
var text = document.createElement("textarea"); // replaced by
forObj.add(text); It will do the job for me, thanks you! |
I guess I already know what the issue is. In svg.js all elements are create with |
Ok, thanks for the explanation. :) Oh I see... And |
Exactly! Albeit in your case you use an html fragment ( |
Yes you're right. I forgot to mention that html fragment works well (ie: |
Oh really? But textarea does not work? Strange... |
Yes, strange, indeed... |
Actually this work. As I said above it is required to create the element using Working fiddle: https://jsfiddle.net/Fuzzy/v1Lbhnjw/ |
Albeit all elements are in the DOM |
Your picture clearly shows the textarea. Please elaborate |
Thanks for your answer. |
yes thats because I only focused on the form element and not the text. But the same problem applies here. You have to create it manually. See upated fiddle: https://jsfiddle.net/Fuzzy/v1Lbhnjw/ I plan on resolving this issue by allowing a second parameter in |
Thanks. |
### Fixed - fixed `zoom()` method of runner which was passed a wrong parameter - fixed positioning methods of `TSpan` to position them by its bounding box - fixed `flip()` method which flips correctly by center by default now and accepts correct arguments - fixed a case in `rbox()` where not always all values of the box were updated - fixed `getOrigin()` function used by `transform()` so that all origin (#1085) popssibilities specified in the docs are working - fixed positioning of text by its baseline when using `amove()` - fixed tons of typings in the svg.d.ts file ### Added - added second Parameter to `SVG(el, isHTML)` which allows to explicitely create elements in the HTML namespace (#1058) - added `unlink()` and `linker()` to hyperlinked elements to remove or access the underling `<a>` element - added `wrap()` method to `Dom` which lets you wrap an element by another one - added `orient()` method to `Marker` - added `options` parameter to `dispatch()` and `fire()` to allow for more special needs - added `newLine()` constructor to `Text` to create a tspan marked as new line (#1088) - added lots of tests in es6 format
I don't know if it's a bug, really. But the ForeignObject element does not seem to work as expected for me.
I tried this pretty simple code :
Here is the code running in Fiddle : https://jsfiddle.net/MrJeanJean/hxdptc75/
On my browsers (Chrome & Firefox), the textarea element is not showing at all.
The weird thing here, is that the textarea exists in the DOM (I can inspect it and see it in the DOM tree), but it's not considered as html element by the browser (no CSS default styles applied, not editable, content is not displayed...).
Maybe I did something wrong.
Thanks.
The text was updated successfully, but these errors were encountered: