Add note about proper setting of sizes to Wodo.TextEditor How-to FAQ#715
Add note about proper setting of sizes to Wodo.TextEditor How-to FAQ#715kossebau wants to merge 1 commit intowebodf:masterfrom
Conversation
|
Build succeeded. |
There was a problem hiding this comment.
We should have a default size (even 200x200 is fine) set on the <div> to minimize developer confusion. Once I can see where the element is and how it looks like, I can adapt the size myself using the instructions below.
There was a problem hiding this comment.
So you mean see if editorDiv.style.height and style.width is not set on creation, then set something as default? Hm...
There was a problem hiding this comment.
If you're understandably uncomfortable about that - note that there is a precedent for such things in HTML5, for example a textarea has a default width and height as well.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
There was a problem hiding this comment.
Hm. textarea has the advantage that the browser can simply calculate the pixel size derived from the default size given in columns and lines... whereas we here would have to do some more complicated calculation of a sensible size in pixels from things like what elements are on the toolbar and what page size the document might have.
IMHO an automatic default size should be something sensible, delivering a setup that is useful. Otherwise it makes a bad impression. Some randomly set default size just to help people seeing the element is not a good enough reason I think. Because then some people might rely on the default size, and if we change it in the future, things will break for them and they will be unhappy.
So until we have code to calculate sensible default sizes (and thus also a sensible minimal size) I don't think we should have a default size.
No description provided.