Opt-Space no longer scrolls (Chrome OSX) #244
Conversation
editorState.getSelection(), | ||
' ' | ||
); | ||
this.update(EditorState.push(editorState, contentState, 'space')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct EditorChangeType
here is 'insert-characters'
. (I need to document this, but one should always stick to the EditorChangeType
values for push
calls.)
@brookslyrette on the import I ran for your last PR, our bot pulled in changes that had already been merged, I assume because the commits were still present in this stack. Can those older changes be rebased out of this PR? Regarding the PR itself, I'm wondering if this should be handled within |
Thanks @hellendag. I'll make the corrections and rebase the PR. I had attempted to prevent the scrolling in I'm happy to do so if you think it's a cleaner approach. What name would be appropriate for the command? |
Oh of course, that's a great point. There would have to be a command string for it. Let's stick with what you have. Were you able to determine what's actually causing this? I.e. why would Draft behave differently from a plain contenteditable? |
Hmm, though that div is the
No worries, I'll see if I can track it down. :) |
Just a hunch. This only seems to happen when Not sure if it's a redraw or the placeholder causing it but I'm sure it has to do with the initial state. |
It happens whenever we have to It seems that if the Since we need to prevent the |
const contentState = DraftModifier.replaceText( | ||
editorState.getCurrentContent(), | ||
editorState.getSelection(), | ||
' ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct character to insert here, if the goal of Opt+Space is to insert a non-breaking space? Or should this be '\u00a0'
?
Thanks! |
@facebook-github-bot import |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
358dc59
Summary:`Option + Space` no longer causes scrolling. This was only happening in Chrome/OSX. This was happening in the keyDown handler not the keyPress handler. I'm not sure if I like adding the ' ' to the editor in editOnKeyDown. Maybe I should implement this as a command? Fixes #19 Closes facebookarchive/draft-js#244 Reviewed By: spicyj Differential Revision: D3132586 fb-gh-sync-id: b94bd73094a58ce9b39528df34b899ae62366761 fbshipit-source-id: b94bd73094a58ce9b39528df34b899ae62366761
Summary:`Option + Space` no longer causes scrolling. This was only happening in Chrome/OSX. This was happening in the keyDown handler not the keyPress handler. I'm not sure if I like adding the ' ' to the editor in editOnKeyDown. Maybe I should implement this as a command? Fixes #19 Closes facebookarchive/draft-js#244 Reviewed By: spicyj Differential Revision: D3132586 fb-gh-sync-id: b94bd73094a58ce9b39528df34b899ae62366761 fbshipit-source-id: b94bd73094a58ce9b39528df34b899ae62366761
Option + Space
no longer causes scrolling. This was only happening in Chrome/OSX. This was happening in the keyDown handler not the keyPress handler.I'm not sure if I like adding the ' ' to the editor in editOnKeyDown. Maybe I should implement this as a command?
Fixes #19