refactory-id / bootstrap-markdown

Bootstrap plugin for markdown editing
Apache License 2.0
1.99k stars 371 forks source link

Entering the text scrolls up the entire page to the top of window. #174

Open kingtrivs27 opened 9 years ago

kingtrivs27 commented 9 years ago

In some versions of Chrome (I saw on Macbook Chrome Version 42.0.2311.90) Editor scrolls up to the top of page or sometimes to the scrolltop position of editor area when new any of the cmd button is clicked on editor - tollbar.

Steps to reproduce similar scenario:

  1. enter multiple line text in editor so that scroller starts coming int it.
  2. now select some text to decorate from the bottom of editor scroll area and click some button on tollbar (to decorate the content), say we click on Bold (B) button.
  3. On click the complete screen scrolls up or the scroll area of editor scrolls up. This can be reproduced even in http://www.codingdrama.com/bootstrap-markdown/ Please help.
kingtrivs27 commented 9 years ago

I guess the following line at the end of every cmd button click event is causing the issue e.setSelection(cursor,cursor+chunk.length);