mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
fix(T1758): Handle initial focus properly if draft is not yet ready
This commit is contained in:
parent
42819e4d71
commit
6f16659a30
1 changed files with 10 additions and 0 deletions
|
@ -360,6 +360,10 @@ class ComposerView extends React.Component
|
|||
# focused depending on the draft type, or you can pass a field as
|
||||
# the first parameter.
|
||||
focus: (field = null) =>
|
||||
if not @_proxy
|
||||
@_focusRequested = true
|
||||
return
|
||||
|
||||
if @isForwardedMessage()
|
||||
field ?= "textFieldTo"
|
||||
else
|
||||
|
@ -375,9 +379,15 @@ class ComposerView extends React.Component
|
|||
_onDraftChanged: =>
|
||||
return unless @_proxy
|
||||
draft = @_proxy.draft()
|
||||
|
||||
if not @_initialHistorySave
|
||||
@_saveToHistory()
|
||||
@_initialHistorySave = true
|
||||
|
||||
if @_focusRequested
|
||||
@_focusRequested = false
|
||||
@focus()
|
||||
|
||||
state =
|
||||
to: draft.to
|
||||
cc: draft.cc
|
||||
|
|
Loading…
Reference in a new issue