Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Allow Option+Space to be handled on OSX Chrome #1254

Closed
wants to merge 1 commit into from

Conversation

colinjeanne
Copy link
Contributor

Summary

Currently pressing Option+Space in Chrome on OSX will cause a nonbreaking space to always be inserted into the editor. This behavior ignores any key bindings that the editor has set.

This change moves the logic which adds the non breaking space to after the point that the key binding function has been run in order to give editors a chance to handle this behavior on their own.

Test Plan

This has been tested manually since there are no current tests for the event handlers and no current framework for testing the handlers. We have been running with this change in our fork of Draft for about seven months without issue.

@niveditc
Copy link
Contributor

niveditc commented Oct 7, 2018

@colinjeanne - apologies for the delay in reviewing this.

Regarding the bundle size files, I think you can ignore them & remove them from the commit. Could you do that and rebase on master? (side note: I saw your PM on Slack and am looking into the possibility of adding this to .gitignore and/or automatically generating those files)

Currently pressing Option+Space in Chrome on OSX will cause a non breaking space to always be inserted into the editor. This behavior ignores any key bindings that the editor has set.

This change moves the logic which adds the non breaking space to after the point that the key binding function has been run in order to give editors a chance to handle this behavior on their own.
Copy link
Contributor

@niveditc niveditc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@niveditc
Copy link
Contributor

niveditc commented Oct 8, 2018

Next steps are:

  • I'll import this and run FB's test stack.
  • Do a few sanity checks in the browser.
  • Provided the steps above are successful I'll merge it in. I'm limiting riskier merges to Draft.js to working hours and staggering them by a couple of hours each to be able to quickly bisect & revert in the slim chance that something breaks. So I estimate that this one will be merged towards EOD today or sometime tomorrow.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niveditc has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@colinjeanne colinjeanne deleted the capture-nbsp branch October 10, 2018 18:49
jdecked pushed a commit to twitter-forks/draft-js that referenced this pull request Oct 9, 2019
Summary:
**Summary**

Currently pressing Option+Space in Chrome on OSX will cause a nonbreaking space to always be inserted into the editor. This behavior ignores any key bindings that the editor has set.

This change moves the logic which adds the non breaking space to after the point that the key binding function has been run in order to give editors a chance to handle this behavior on their own.

**Test Plan**

This has been tested manually since there are no current tests for the event handlers and no current framework for testing the handlers. We have been running [with this change in our fork of Draft](textioHQ@f4c3aeb) for about seven months without issue.
Pull Request resolved: facebookarchive#1254

Differential Revision: D10241854

fbshipit-source-id: b8fe92a4f76bbb7543efdb3e5deca1dbdbc0960c
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

Currently pressing Option+Space in Chrome on OSX will cause a nonbreaking space to always be inserted into the editor. This behavior ignores any key bindings that the editor has set.

This change moves the logic which adds the non breaking space to after the point that the key binding function has been run in order to give editors a chance to handle this behavior on their own.

**Test Plan**

This has been tested manually since there are no current tests for the event handlers and no current framework for testing the handlers. We have been running [with this change in our fork of Draft](textioHQ/draft-js@f4c3aeb) for about seven months without issue.
Pull Request resolved: facebookarchive/draft-js#1254

Differential Revision: D10241854

fbshipit-source-id: b8fe92a4f76bbb7543efdb3e5deca1dbdbc0960c
aforismesen added a commit to aforismesen/draft-js that referenced this pull request Jul 12, 2024
Summary:
**Summary**

Currently pressing Option+Space in Chrome on OSX will cause a nonbreaking space to always be inserted into the editor. This behavior ignores any key bindings that the editor has set.

This change moves the logic which adds the non breaking space to after the point that the key binding function has been run in order to give editors a chance to handle this behavior on their own.

**Test Plan**

This has been tested manually since there are no current tests for the event handlers and no current framework for testing the handlers. We have been running [with this change in our fork of Draft](textioHQ/draft-js@f4c3aeb) for about seven months without issue.
Pull Request resolved: facebookarchive/draft-js#1254

Differential Revision: D10241854

fbshipit-source-id: b8fe92a4f76bbb7543efdb3e5deca1dbdbc0960c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants