This commit is contained in:
the-djmaze 2022-11-15 14:45:38 +01:00
parent 9cda088645
commit 676d379e29
2 changed files with 7 additions and 12 deletions

View file

@ -272,15 +272,11 @@ export class ComposePopupView extends AbstractViewPopup {
currentIdentity: IdentityUserStore()[0] currentIdentity: IdentityUserStore()[0]
}); });
// this.to.subscribe((v) => console.log(v));
// Used by ko.bindingHandlers.emailsTags // Used by ko.bindingHandlers.emailsTags
this.to.focused = ko.observable(false); ['to','cc','bcc'].forEach(name => {
this.to.focused.subscribe(value => value && (this.sLastFocusedField = 'to')); this[name].focused = ko.observable(false);
this.cc.focused = ko.observable(false); this[name].focused.subscribe(value => value && (this.sLastFocusedField = name));
this.cc.focused.subscribe(value => value && (this.sLastFocusedField = 'cc')); });
this.bcc.focused = ko.observable(false);
this.bcc.focused.subscribe(value => value && (this.sLastFocusedField = 'bcc'));
this.attachments = koArrayWithDestroy(); this.attachments = koArrayWithDestroy();
@ -1014,9 +1010,8 @@ export class ComposePopupView extends AbstractViewPopup {
setTimeout(() => { setTimeout(() => {
if (!this.to()) { if (!this.to()) {
this.to.focused(true); this.to.focused(true);
// TODO https://github.com/the-djmaze/snappymail/issues/501#issuecomment-1255906243 } else if (!this.subject()) {
// } else if (!this.subject()) { this.viewModelDom.querySelector('input[name="subject"]').focus();
// this.subject.focus();
} else { } else {
this.oEditor?.focus(); this.oEditor?.focus();
} }

View file

@ -124,7 +124,7 @@
<tr> <tr>
<td data-i18n="GLOBAL/SUBJECT"></div> <td data-i18n="GLOBAL/SUBJECT"></div>
<td> <td>
<input type="text" size="70" autocomplete="off" data-bind="textInput: subject"> <input type="text" name="subject" autocomplete="off" data-bind="textInput: subject">
</td> </td>
</tr> </tr>
</table> </table>