Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
286 views
in Technique[技术] by (71.8m points)

javascript - TinyMce scroll issue on texts larger than screen height

TinyMce editor does not focus on caret position but in the middle of the editor when the editor is taller than the screen size. It only happens on enter (new line).

This is more persistant on Firefox browser.

My config:

public config: any = {
mode: 'exact',
selector: 'textarea',
autoresize_bottom_margin: 50,
skin: false,
content_css: '/assets/skins/content.css',
menubar: false,
height: 150,
width: 1000,
min_width: 600,
max_width: 1000,
min_height: 150,
toolbar: [
  'print | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect fontsizeselect fontselect  forecolor backcolor insertdatetime',
  'cut copy paste | numlist bullist | indent outdent | undo redo | link unlink anchor image | hr removeformat  | subscript superscript | charmap emoticons'
],
toolbar_items_size : 'small',
plugins: ['lists', 'autoresize', 'link', 'anchor', 'code', 'hr', 'charmap', 'insertdatetime', 'emoticons', 'image', 'imagetools', 'paste'],
image_advtab: true,
paste_as_text: false,
resize: 'both',
statusbar: true,
toolbar_persist: true,
toolbar_sticky: true,
paste_data_images: true,
powerpaste_allow_local_images: true,
powerpaste_word_import: 'prompt',
contextmenu: 'cut copy paste image imagetools ',
forced_root_block: false,
autofocus: false,
id: 'tinymce',
setup: editor => {
  editor.on('init', _ => {
    this.editor = editor;
    this.editor.execCommand('mceInsertContent', false, "</br> ");
  })
}
};

Is there any workaround to this problem?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...