mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-09-23 18:28:25 +00:00
CodeMirrorWikiEditor: scroll selection into view on inital load
Without the scrollIntoView option set, CodeMirror will always scroll to the bottom. See: https://codemirror.net/docs/ref/#state.TransactionSpec.scrollIntoView Bug: T317243 Change-Id: I3174685cd3508abf8074eb47e8f2bf81bd303916
This commit is contained in:
parent
361741ec86
commit
314bd6d8c4
2
resources/dist/main.js
vendored
2
resources/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
resources/dist/main.js.map.json
vendored
2
resources/dist/main.js.map.json
vendored
File diff suppressed because one or more lines are too long
|
@ -76,7 +76,8 @@ export default class CodeMirrorWikiEditor extends CodeMirror {
|
|||
this.view.dispatch( {
|
||||
selection: EditorSelection.create( [
|
||||
EditorSelection.range( selectionStart, selectionEnd )
|
||||
] )
|
||||
] ),
|
||||
scrollIntoView: true
|
||||
} );
|
||||
if ( hasFocus ) {
|
||||
this.view.focus();
|
||||
|
|
Loading…
Reference in a new issue