File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,7 @@ class Keyboard extends Module {
362
362
this . quill . updateContents ( delta , Quill . sources . USER ) ;
363
363
this . quill . setSelection ( range . index + 1 , Quill . sources . SILENT ) ;
364
364
this . quill . focus ( ) ;
365
+ context . line . domNode . scrollIntoView ( false ) ;
365
366
366
367
Object . keys ( context . format ) . forEach ( name => {
367
368
if ( lineFormats [ name ] != null ) return ;
Original file line number Diff line number Diff line change @@ -229,6 +229,15 @@ describe('quill', function() {
229
229
html = await page . $eval ( '.ql-editor' , e => e . innerHTML ) ;
230
230
expect ( html ) . toEqual ( `<p>12 </p><p>${ EMBED } 34</p>` ) ;
231
231
232
+ const windowScrollY = await page . $eval ( 'html' , e => e . scrollTop ) ;
233
+ await page . click ( '#content' ) ;
234
+ await page . keyboard . press ( 'Enter' ) ;
235
+ await page . keyboard . press ( 'Enter' ) ;
236
+ await page . keyboard . press ( 'Enter' ) ;
237
+ const actualWindowScrollY = await page . $eval ( 'html' , e => e . scrollTop ) ;
238
+
239
+ expect ( actualWindowScrollY ) . toBeGreaterThan ( windowScrollY ) ;
240
+
232
241
await browser . close ( ) ;
233
242
} ) ;
234
243
} ) ;
Original file line number Diff line number Diff line change 15
15
< button id ="italic "> Italic</ button >
16
16
< button id ="header "> Header</ button >
17
17
< button id ="embed "> Insert embed</ button >
18
+ < button id ="content "> Insert much more content</ button >
18
19
19
20
< div id ="editor "> </ div >
20
21
</ div >
62
63
editor . focus ( ) ;
63
64
editor . setSelection ( 4 , 0 ) ;
64
65
} ) ;
66
+
67
+ document
68
+ . getElementById ( 'content' )
69
+ . addEventListener ( 'click' , ( ) => {
70
+ const content = new Array ( 150 ) . fill ( 'lorem\n' ) . join ( '' ) ;
71
+
72
+ editor . setContents ( {
73
+ ops : [ { insert : content } ]
74
+ } ) ;
75
+
76
+ editor . focus ( ) ;
77
+ editor . setSelection ( editor . getLength ( ) - 1 , 0 ) ;
78
+ } ) ;
65
79
</ script >
66
80
</ html >
You can’t perform that action at this time.
0 commit comments