问题
CKEditor bug tracker won't let me submit a bug:
== Steps to reproduce ==
add the css:
body { height:100%; }
to an editing area. Use this page and edit the CKEditor area's css with FireBug.Now scroll down and change the bottom
H2
toH3
with the drop-downIt 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