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

Commit

Permalink
Reaping draft_killswitch_allow_nontextnodes
Browse files Browse the repository at this point in the history
Reviewed By: kedromelon

Differential Revision: D17204758

fbshipit-source-id: 406a4db6d467c18757db0e1d25a4a833365a7bd2
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Sep 6, 2019
1 parent db64f93 commit 0e2e9a7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/component/handlers/edit/editOnInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const UserAgent = require('UserAgent');

const {notEmptyKey} = require('draftKeyUtils');
const findAncestorOffsetKey = require('findAncestorOffsetKey');
const gkx = require('gkx');
const keyCommandPlainBackspace = require('keyCommandPlainBackspace');
const nullthrows = require('nullthrows');

Expand Down Expand Up @@ -68,20 +67,13 @@ function editOnInput(editor: DraftEditor, e: SyntheticInputEvent<>): void {
const domSelection = global.getSelection();

const {anchorNode, isCollapsed} = domSelection;
const isNotTextNode = anchorNode.nodeType !== Node.TEXT_NODE;
const isNotTextOrElementNode =
anchorNode.nodeType !== Node.TEXT_NODE &&
anchorNode.nodeType !== Node.ELEMENT_NODE;

if (gkx('draft_killswitch_allow_nontextnodes')) {
if (isNotTextNode) {
return;
}
} else {
if (isNotTextOrElementNode) {
// TODO: (t16149272) figure out context for this change
return;
}
if (isNotTextOrElementNode) {
// TODO: (t16149272) figure out context for this change
return;
}

if (
Expand Down

0 comments on commit 0e2e9a7

Please sign in to comment.