mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
fix(popover): Critical binding fix for popover
This commit is contained in:
parent
2442e0d6b6
commit
90d78c8bea
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue