-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix error when anchorNode is missing in editOnInput #1586
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Hi @eldh! |
Yeah, I agree it feels a bit weird. I'll dig a bit deeper! 👍 |
As to the question of why this happens: The case here is that the editor loses focus before If not, is it correct to return in all cases? From what I can tell, the happy case on I'm probably missing a lot of context here, not sure in which other cases |
…und (#2242) Summary: Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.1 to 4.5.1. <details> <summary>Changelog</summary> *Sourced from [handlebars's changelog](https://github.com/wycats/handlebars.js/blob/v4.5.1/release-notes.md).* > ## v4.5.1 - October 29th, 2019 > Bugfixs > > - fix: move "eslint-plugin-compat" to devDependencies - 5e9d17f ([https://github.com/facebook/draft-js/issues/1589](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1589)) > > Compatibility notes: > - No compatibility issues are to be expected > > > [Commits](handlebars-lang/handlebars.js@v4.5.0...v4.5.1) > > ## v4.5.0 - October 28th, 2019 > Features / Improvements > - Add method Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - 62ed3c2 > - add guard to if & unless helpers ([https://github.com/facebook/draft-js/issues/1549](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1549)) > - show source location for the strict lookup exceptions - feb60f8 > > Bugfixes: > - Use objects for hash value tracking - 7fcf9d2 > > Chore: > - Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - 7052e88 > - chore: add eslint-plugin-compat and eslint-plugin-es5 - 088e618 > > Compatibility notes: > - No compatibility issues are to be expected > > [Commits](handlebars-lang/handlebars.js@v4.4.5...v4.5.0) > > ## v4.4.5 - October 20th, 2019 > Bugfixes: > > - Contents of raw-blocks must be matched with non-eager regex-matching - 8d5530e, [https://github.com/facebook/draft-js/issues/1579](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1579) > > > > [Commits](handlebars-lang/handlebars.js@v4.4.4...v4.4.5) > > ## v4.4.4 - October 20th, 2019 > Bugfixes: > - fix: prevent zero length tokens in raw-blocks ([https://github.com/facebook/draft-js/issues/1577](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1577), [https://github.com/facebook/draft-js/issues/1578](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1578)) - f1752fe > > Chore: > - chore: link to s3 bucket with https, add "npm ci" to build instructions - 0b593bf > > Compatibility notes: > - no compatibility issues are expected > > [Commits](handlebars-lang/handlebars.js@v4.4.3...v4.4.4) > ></tr></table> ... (truncated) </details> <details> <summary>Commits</summary> - [`7ef8617`](handlebars-lang/handlebars.js@7ef8617) v4.5.1 - [`b75e3e1`](handlebars-lang/handlebars.js@b75e3e1) Update release notes - [`5e9d17f`](handlebars-lang/handlebars.js@5e9d17f) fix: move "eslint-plugin-compat" to devDependencies - [`b24797d`](handlebars-lang/handlebars.js@b24797d) v4.5.0 - [`a243067`](handlebars-lang/handlebars.js@a243067) Update release notes - [`088e618`](handlebars-lang/handlebars.js@088e618) chore: add eslint-plugin-compat and eslint-plugin-es5 - [`7052e88`](handlebars-lang/handlebars.js@7052e88) Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - [`b8913fc`](handlebars-lang/handlebars.js@b8913fc) Add missing types for the Exception class properties ([https://github.com/facebook/draft-js/issues/1583](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1583)) - [`62ed3c2`](handlebars-lang/handlebars.js@62ed3c2) Add Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - [`7fcf9d2`](handlebars-lang/handlebars.js@7fcf9d2) Use objects for hash value tracking - Additional commits viewable in [compare view](handlebars-lang/handlebars.js@v4.1.1...v4.5.1) </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=npm_and_yarn&previous-version=4.1.1&new-version=4.5.1)](https://help.github.com/articles/configuring-automated-security-fixes) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/draft-js/network/alerts). </details> Pull Request resolved: #2242 Differential Revision: D18314832 Pulled By: mrkev fbshipit-source-id: a021417222e0eddabc7816eeb0468f2c91ace9d9
…und (facebookarchive#2242) Summary: Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.1 to 4.5.1. <details> <summary>Changelog</summary> *Sourced from [handlebars's changelog](https://github.com/wycats/handlebars.js/blob/v4.5.1/release-notes.md).* > ## v4.5.1 - October 29th, 2019 > Bugfixs > > - fix: move "eslint-plugin-compat" to devDependencies - 5e9d17f ([https://github.com/facebook/draft-js/issues/1589](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1589)) > > Compatibility notes: > - No compatibility issues are to be expected > > > [Commits](handlebars-lang/handlebars.js@v4.5.0...v4.5.1) > > ## v4.5.0 - October 28th, 2019 > Features / Improvements > - Add method Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - 62ed3c2 > - add guard to if & unless helpers ([https://github.com/facebook/draft-js/issues/1549](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1549)) > - show source location for the strict lookup exceptions - feb60f8 > > Bugfixes: > - Use objects for hash value tracking - 7fcf9d2 > > Chore: > - Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - 7052e88 > - chore: add eslint-plugin-compat and eslint-plugin-es5 - 088e618 > > Compatibility notes: > - No compatibility issues are to be expected > > [Commits](handlebars-lang/handlebars.js@v4.4.5...v4.5.0) > > ## v4.4.5 - October 20th, 2019 > Bugfixes: > > - Contents of raw-blocks must be matched with non-eager regex-matching - 8d5530e, [https://github.com/facebook/draft-js/issues/1579](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1579) > > > > [Commits](handlebars-lang/handlebars.js@v4.4.4...v4.4.5) > > ## v4.4.4 - October 20th, 2019 > Bugfixes: > - fix: prevent zero length tokens in raw-blocks ([https://github.com/facebook/draft-js/issues/1577](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1577), [https://github.com/facebook/draft-js/issues/1578](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1578)) - f1752fe > > Chore: > - chore: link to s3 bucket with https, add "npm ci" to build instructions - 0b593bf > > Compatibility notes: > - no compatibility issues are expected > > [Commits](handlebars-lang/handlebars.js@v4.4.3...v4.4.4) > ></tr></table> ... (truncated) </details> <details> <summary>Commits</summary> - [`7ef8617`](handlebars-lang/handlebars.js@7ef8617) v4.5.1 - [`b75e3e1`](handlebars-lang/handlebars.js@b75e3e1) Update release notes - [`5e9d17f`](handlebars-lang/handlebars.js@5e9d17f) fix: move "eslint-plugin-compat" to devDependencies - [`b24797d`](handlebars-lang/handlebars.js@b24797d) v4.5.0 - [`a243067`](handlebars-lang/handlebars.js@a243067) Update release notes - [`088e618`](handlebars-lang/handlebars.js@088e618) chore: add eslint-plugin-compat and eslint-plugin-es5 - [`7052e88`](handlebars-lang/handlebars.js@7052e88) Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - [`b8913fc`](handlebars-lang/handlebars.js@b8913fc) Add missing types for the Exception class properties ([https://github.com/facebook/draft-js/issues/1583](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1583)) - [`62ed3c2`](handlebars-lang/handlebars.js@62ed3c2) Add Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - [`7fcf9d2`](handlebars-lang/handlebars.js@7fcf9d2) Use objects for hash value tracking - Additional commits viewable in [compare view](handlebars-lang/handlebars.js@v4.1.1...v4.5.1) </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=npm_and_yarn&previous-version=4.1.1&new-version=4.5.1)](https://help.github.com/articles/configuring-automated-security-fixes) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/draft-js/network/alerts). </details> Pull Request resolved: facebookarchive#2242 Differential Revision: D18314832 Pulled By: mrkev fbshipit-source-id: a021417222e0eddabc7816eeb0468f2c91ace9d9
…und (facebookarchive#2242) Summary: Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.1 to 4.5.1. <details> <summary>Changelog</summary> *Sourced from [handlebars's changelog](https://github.com/wycats/handlebars.js/blob/v4.5.1/release-notes.md).* > ## v4.5.1 - October 29th, 2019 > Bugfixs > > - fix: move "eslint-plugin-compat" to devDependencies - 5e9d17f ([https://github.com/facebook/draft-js/issues/1589](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1589)) > > Compatibility notes: > - No compatibility issues are to be expected > > > [Commits](handlebars-lang/handlebars.js@v4.5.0...v4.5.1) > > ## v4.5.0 - October 28th, 2019 > Features / Improvements > - Add method Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - 62ed3c2 > - add guard to if & unless helpers ([https://github.com/facebook/draft-js/issues/1549](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1549)) > - show source location for the strict lookup exceptions - feb60f8 > > Bugfixes: > - Use objects for hash value tracking - 7fcf9d2 > > Chore: > - Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - 7052e88 > - chore: add eslint-plugin-compat and eslint-plugin-es5 - 088e618 > > Compatibility notes: > - No compatibility issues are to be expected > > [Commits](handlebars-lang/handlebars.js@v4.4.5...v4.5.0) > > ## v4.4.5 - October 20th, 2019 > Bugfixes: > > - Contents of raw-blocks must be matched with non-eager regex-matching - 8d5530e, [https://github.com/facebook/draft-js/issues/1579](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1579) > > > > [Commits](handlebars-lang/handlebars.js@v4.4.4...v4.4.5) > > ## v4.4.4 - October 20th, 2019 > Bugfixes: > - fix: prevent zero length tokens in raw-blocks ([https://github.com/facebook/draft-js/issues/1577](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1577), [https://github.com/facebook/draft-js/issues/1578](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1578)) - f1752fe > > Chore: > - chore: link to s3 bucket with https, add "npm ci" to build instructions - 0b593bf > > Compatibility notes: > - no compatibility issues are expected > > [Commits](handlebars-lang/handlebars.js@v4.4.3...v4.4.4) > ></tr></table> ... (truncated) </details> <details> <summary>Commits</summary> - [`7ef8617`](handlebars-lang/handlebars.js@7ef8617) v4.5.1 - [`b75e3e1`](handlebars-lang/handlebars.js@b75e3e1) Update release notes - [`5e9d17f`](handlebars-lang/handlebars.js@5e9d17f) fix: move "eslint-plugin-compat" to devDependencies - [`b24797d`](handlebars-lang/handlebars.js@b24797d) v4.5.0 - [`a243067`](handlebars-lang/handlebars.js@a243067) Update release notes - [`088e618`](handlebars-lang/handlebars.js@088e618) chore: add eslint-plugin-compat and eslint-plugin-es5 - [`7052e88`](handlebars-lang/handlebars.js@7052e88) Resolve deprecation warning message from eslint while running eslint ([https://github.com/facebook/draft-js/issues/1586](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1586)) - [`b8913fc`](handlebars-lang/handlebars.js@b8913fc) Add missing types for the Exception class properties ([https://github.com/facebook/draft-js/issues/1583](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1583)) - [`62ed3c2`](handlebars-lang/handlebars.js@62ed3c2) Add Handlebars.parseWithoutProcessing ([https://github.com/facebook/draft-js/issues/1584](https://github-redirect.dependabot.com/wycats/handlebars.js/issues/1584)) - [`7fcf9d2`](handlebars-lang/handlebars.js@7fcf9d2) Use objects for hash value tracking - Additional commits viewable in [compare view](handlebars-lang/handlebars.js@v4.1.1...v4.5.1) </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=npm_and_yarn&previous-version=4.1.1&new-version=4.5.1)](https://help.github.com/articles/configuring-automated-security-fixes) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/draft-js/network/alerts). </details> Pull Request resolved: facebookarchive#2242 Differential Revision: D18314832 Pulled By: mrkev fbshipit-source-id: a021417222e0eddabc7816eeb0468f2c91ace9d9
Fix for issue related to #1399. The fix is similar to #1407, in that it checks if
anchorNode
is falsy and if so bails.