Quill: Pasting will jump the back to the top

Created on 12 Jun 2014  路  14Comments  路  Source: quilljs/quill

After pasting something into the editor, it'll jump the view back to the top (if it's scrolling). The cursor will remain where it was, but it looks as though you're at the top again.

Quill 0.13.3 (slightly customised to allow stylesheet URL's)

bug

All 14 comments

I was able to reproduce on the latest version of Quill as well. Thank you for reporting.

No problem, glad it's not just me!

This is still happening on 0.15.0 - not that it was expected to be fixed.

I've been getting a few moans and groans from the people who are using our system about this, so I've started looking at the issue now.

My thought is that the paste-manager.coffee creates a .paste-container element, which on paste is focused. Since the position is weird, it may be this which is jumping the view back to the top, whilst the cursor remains in place?

Does this need to be focused?

I removed the @container.focus() call and now it no longer jumps the view back to the top, however the cursor remains at the beginning of the pasted content (and not the end), so we're at least a step forward.

I made a 90% fix that hasn't been committed yet. The change prevents the jump to top but if you paste enough content beyond the bottom of the editor it does not scroll down. I'm working on some test infrastructure stuff right now but if I don't get to a good stopping point by tomorrow I'll just push the fix.

Do we know why your fix doesn't work with long content?

It does that because the workaround targets the symptom of it jumping to the top. I have not figured out the cause of the problem yet which is what a 100% fix would do. In the meantime v0.15.2 has the workaround and most pastes should not be long enough for the limitation to be noticed.

The cause of the problem is that when you focus something the browser scrolls automatically to that element. Ran into that a while ago (in my case with some checkbox custom styling).

Thanks for the info @rafales. The focus switch can't be avoided so we'll have to address the symptom in this case. The complete fix is on the develop branch and will be available in the next release.

Hi there. Actually I encountered the same issue. Can you fix it in the next release?

We are experiencing the same issue with the latest 1.3.4 release even with small text portions. The issue could be easily reproduced in the demo editor on https://quilljs.com/
Why do yo close this issue?

@dzagorovsky It was closed because it was fixed. The commit hash is referenced. If you think there is a regression please fill out a separate issue with all the details requested.

2027

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benbro picture benbro  路  3Comments

GildedHonour picture GildedHonour  路  3Comments

Kivylius picture Kivylius  路  3Comments

aletorrado picture aletorrado  路  3Comments

DaniilVeriga picture DaniilVeriga  路  3Comments