fix(popover): Critical binding fix for popover

This commit is contained in:
Ben Gotow 2015-07-24 17:02:27 -07:00
parent 2442e0d6b6
commit 90d78c8bea
2 changed files with 4 additions and 4 deletions

View file

@ -18,7 +18,7 @@ LabelColorizer =
class MailLabel extends React.Component
@propTypes:
label: React.PropTypes.object.isRequired
onRemove: React.PropTypes.function
onRemove: React.PropTypes.func
shouldComponentUpdate: (nextProps, nextState) ->
return false if nextProps.label.id is @props.label.id

View file

@ -78,7 +78,7 @@ class Popover extends React.Component
componentWillUnmount: =>
window.removeEventListener("resize", @_resetPositionState)
componentDidUpdate: ->
componentDidUpdate: =>
if @_focusOnOpen
@_focusImportantElement()
@_focusOnOpen = false
@ -97,7 +97,7 @@ class Popover extends React.Component
# We need to make sure that we're not rendered off the edge of the
# browser window.
_resetPositionState: ->
_resetPositionState: =>
return unless @state.showing
rect = React.findDOMNode(@refs.popover).getBoundingClientRect()
dimensions =
@ -120,7 +120,7 @@ class Popover extends React.Component
node = React.findDOMNode(@refs.popover)
# _.sortBy ranks in ascending numerical order.
matches = _.sortBy node.querySelectorAll("[tabIndex], input"), (node) ->
matches = _.sortBy node.querySelectorAll("[tabIndex], input"), (node) =>
if node.tabIndex > 0
return node.tabIndex
else if node.nodeName is "INPUT"