Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll behaviour #231

Closed
dhoko opened this issue Sep 1, 2016 · 7 comments
Closed

Scroll behaviour #231

dhoko opened this issue Sep 1, 2016 · 7 comments

Comments

@dhoko
Copy link
Contributor

dhoko commented Sep 1, 2016

Hi,

There is an issue when you add something inside the editor, ex:

Many paste

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Actual behaviour:
It doesn't scroll for a copy/paste, only if there is a keyup/down.

squiredemoopt

Edit: No scroll for ENTER_KEY.

@ibash
Copy link
Contributor

ibash commented Sep 1, 2016

We deal with this using scrollIntoViewIfNeeded, but there is probably a better way: https://github.com/superhuman/Squire/blob/master/build/squire-raw.js#L1476

@dhoko
Copy link
Contributor Author

dhoko commented Sep 2, 2016

@ibash thx with your fork it works as expected.

@ibash
Copy link
Contributor

ibash commented Sep 2, 2016

@dhoko Note that our fork targets chrome, so we haven't done browser compatibility tests - in particular note that firefox doesn't support scrollIntoViewIfNeeded http://caniuse.com/#search=scrollIntoViewIfNeeded

@dhoko
Copy link
Contributor Author

dhoko commented Sep 2, 2016

hahaha, cool don't have to deploy a test version^^

MDN Element.scrollIntoViewIfNeeded():

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Not part of any specification. This is a proprietary, WebKit-specific method.

Fuuuuu (╯°□°)╯︵ ┻━┻

@ibash
Copy link
Contributor

ibash commented Sep 2, 2016

@neilj
Copy link
Member

neilj commented Sep 28, 2016

Handling the scrolling is up to the integration. Squire can be used in a number of contexts (in an iframe or without, made to expand to fit the content so the scroll area is the whole window, or made so the editor div itself scrolls). The correct way to handle this depends on how it's being used, and does not belong in the editor code itself.

For example, at FastMail, this is how it's handled in our integration. We hook into the input event to check the scroll each time the user makes a content change.

@neilj neilj closed this as completed Sep 28, 2016
@violetakochoska
Copy link

Browser: Firefox
Description: When using the text formatting buttons such as bold or bullets in a long composition they cause the text view to jump to the beginning of the email and you must scroll down to find the place you were last editing. How to repeat this bug: * Paste long passage of text into the editing window * Scroll down to a portion of the text that is not visible after pasting in the text. * select a portion of text to format and click one of the formatting buttons. * The view jumps back to the top of the pasted text. How to resolve this bug: * Make the displayed text stay in view when a formatting button is pressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants