diff --git a/internal_packages/composer-emoji/lib/emoji-button-popover.jsx b/internal_packages/composer-emoji/lib/emoji-button-popover.jsx index 13b4ba535..a8535fc47 100644 --- a/internal_packages/composer-emoji/lib/emoji-button-popover.jsx +++ b/internal_packages/composer-emoji/lib/emoji-button-popover.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import {findDOMNode} from 'react-dom'; import {Actions} from 'nylas-exports'; import {RetinaImg, ScrollRegion} from 'nylas-component-kit'; @@ -234,7 +235,7 @@ class EmojiButtonPopover extends React.Component { } renderCanvas() { - const canvas = React.findDOMNode(this.refs.emojiCanvas); + const canvas = findDOMNode(this.refs.emojiCanvas); const keys = Object.keys(this.state.categoryPositions); canvas.height = this.state.categoryPositions[keys[keys.length - 1]].bottom * 2; const ctx = canvas.getContext("2d"); diff --git a/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx b/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx index a281cab54..83f1766e8 100644 --- a/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx +++ b/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx @@ -1,4 +1,5 @@ import React, {addons} from 'react/addons'; +import {findDOMNode} from 'react-dom'; import {renderIntoDocument} from '../../../spec/nylas-test-utils'; import Contenteditable from '../../../src/components/contenteditable/contenteditable'; import EmojiButtonPopover from '../lib/emoji-button-popover'; @@ -21,12 +22,12 @@ describe('EmojiButtonPopover', ()=> { onChange={jasmine.createSpy('onChange')} extensions={[EmojiComposerExtension]} /> ); - this.editableNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable')); + this.editableNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable')); this.editableNode.innerHTML = "Testing!"; const sel = document.getSelection() const textNode = this.editableNode.childNodes[0]; sel.setBaseAndExtent(textNode, textNode.nodeValue.length, textNode, textNode.nodeValue.length); - this.canvas = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas')); + this.canvas = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas')); }); describe('when inserting emoji', ()=> { @@ -54,7 +55,7 @@ describe('EmojiButtonPopover', ()=> { describe('when searching for emoji', ()=> { it('should filter for matches', ()=> { - this.searchNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search')) + this.searchNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search')) const event = { target: { value: "heart", diff --git a/src/components/fixed-popover.jsx b/src/components/fixed-popover.jsx index 26036ad50..4b0157653 100644 --- a/src/components/fixed-popover.jsx +++ b/src/components/fixed-popover.jsx @@ -120,7 +120,7 @@ class FixedPopover extends Component { onBlur = (event)=> { const target = event.nativeEvent.relatedTarget; - if (!target || (!React.findDOMNode(this).contains(target))) { + if (!target || (!findDOMNode(this).contains(target))) { Actions.closePopover(); } }; @@ -142,12 +142,14 @@ class FixedPopover extends Component { } }; + static Directions = Directions; + focusElementWithTabIndex = ()=> { if (!this.mounted) { return; } // Automatically focus the element inside us with the lowest tab index - const popoverNode = React.findDOMNode(this); + const popoverNode = findDOMNode(this); // _.sortBy ranks in ascending numerical order. const focusable = popoverNode.querySelectorAll("[tabIndex], input"); diff --git a/src/flux/stores/message-body-processor.es6 b/src/flux/stores/message-body-processor.es6 index fbb30b016..3f903cf37 100644 --- a/src/flux/stores/message-body-processor.es6 +++ b/src/flux/stores/message-body-processor.es6 @@ -1,6 +1,5 @@ import _ from 'underscore'; import Message from '../models/message'; -import MessageUtils from '../models/message-utils'; import MessageStore from './message-store'; import DatabaseStore from './database-store';