sproutcore / rich-text-editor

A rich text editor for SproutCore.
Other
6 stars 6 forks source link

WYSIWYGEditorView#lineHeight is doing it wrong. #14

Open dcporter opened 10 years ago

dcporter commented 10 years ago

There's an issue where if your cursor winds up off the bottom of the editable element (e.g. in the common case of hitting enter to add a new line at the end), the browser repositions the element to keep the cursor visible. A split second later, the view catches up and resizes itself, moving everything back to where it's supposed to be. This creates an ugly jump effect. My solution was to force the developer to specify a lineHeight property – this value is added to the view's height to ensure that the view has enough space at the bottom to allow the user to hit enter without triggering the jump-around.

This is a decidedly unfriendly API. Would be great to figure out another way to resolve or work around this problem.