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

Add note about proper setting of sizes to Wodo.TextEditor How-to FAQ #715

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kossebau
Copy link
Contributor

No description provided.

@kogmbh-ci
Copy link

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/1945/


2. Why is there just a blank screen?

Wodo.TextEditor does not enforce a size on the <div> element which is containing it. So make sure you have set a size on it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you mean see if editorDiv.style.height and style.width is not set on creation, then set something as default? Hm...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants