-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Page automatically scroll to top when focus in Chrome 61 #457
Comments
@scarlet608 : can you plz check if you face this issue here also: https://jpuri.github.io/react-draft-wysiwyg/#/ and here: https://draftjs.org/ |
@jpuri Nope. Sorry for the late reply. I double checked everything and it only appears in my project in Chrome 61. The editor worked totally fine in Firefox, Edge and Safari and it even worked in Chrome 60 (before update) but failed in Chrome 61 and 63. I havn't chnaged a single line of my code. So it seems like a browser behavior. As I mentioned before, this line caused the issue react-draft-wysiwyg/src/Editor/index.js Line 336 in 884424b
and everthing else works perfectly fine. I am really wondering what caused the problem. |
I'm having the same issue with draft-js (autofocus) and Chrome 61 (works fine in Firefox), so looks like it may likely be a Chrome bug? |
That is weird, but yes can be chrome issue 😄 |
When clicking the main part of the editor, the editor will focus (which is expected) but the whole page will automatically scroll to top. I did some digging to the source code and found out that when clicking, this method will be invoked
react-draft-wysiwyg/src/Editor/index.js
Line 334 in 884424b
and caused the page to scroll.
I tried to fix it with an ugly apporach which save the current location first and scroll to it after focus:
This bug only seems to appear in Chorme 61.
The text was updated successfully, but these errors were encountered: