CKeditor jumps to top with certain css

三世轮回 提交于 2020-06-17 07:46:18

问题


CKEditor bug tracker won't let me submit a bug:

== Steps to reproduce ==

  1. add the css: body { height:100%; } to an editing area. Use this page and edit the CKEditor area's css with FireBug.

  2. Now scroll down and change the bottom H2 to H3 with the drop-down

  3. It jumps to the top.

Expected result: Without adding the css or if you deactive it, it behaves correctly, ie., it doesn't jump to the top.

Actual result: It jumps to the top.

Other details (browser, OS, CKEditor version, installed plugins): Broken in FireFox 42 on OS X. Chrome seems to work OK?

In this old discussion people tracked the issue down to their "contentsCss" but didn't further isolate it to this particular issue.


回答1:


Please have a look at attached image. When you set body to 100% it only takes size of the viewport and not the whole body. You can see this clearly when scrolling down the editor. If on the other hand you disable the height:100%, you will see that body is as high as the content.

If you are worried about one line height body when there is no content in the editor then perhaps you might want to use min-height as mentioned here.

I don't see any issue with the editor here because it behaves as expected - it scrolls to top where the body actually is.



来源:https://stackoverflow.com/questions/34110733/ckeditor-jumps-to-top-with-certain-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!