@bobfrankston/rmfmail 1.2.115 → 1.2.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4124,6 +4124,17 @@ function getFromAccountId() {
4124
4124
  function getFromAddress() {
4125
4125
  return fromInput.value.trim();
4126
4126
  }
4127
+ function smartTab(current) {
4128
+ const fields = [toInput, ccInput, bccInput, subjectInput];
4129
+ const currentIdx = fields.indexOf(current);
4130
+ for (let i = currentIdx + 1; i < fields.length; i++) {
4131
+ if (!fields[i].value.trim() && fields[i].offsetParent !== null) {
4132
+ fields[i].focus();
4133
+ return;
4134
+ }
4135
+ }
4136
+ editor.focus();
4137
+ }
4127
4138
  function showAutocompleteContextMenu(e, row) {
4128
4139
  showContextMenu(e.clientX, e.clientY, [
4129
4140
  {
@@ -4370,6 +4381,14 @@ function setupAutocomplete(input) {
4370
4381
  setupAutocomplete(toInput);
4371
4382
  setupAutocomplete(ccInput);
4372
4383
  setupAutocomplete(bccInput);
4384
+ for (const field of [toInput, ccInput, bccInput, subjectInput]) {
4385
+ field.addEventListener("keydown", (e) => {
4386
+ const ke = e;
4387
+ if (ke.key !== "Tab" || ke.shiftKey || ke.ctrlKey || ke.altKey || ke.defaultPrevented) return;
4388
+ ke.preventDefault();
4389
+ smartTab(field);
4390
+ });
4391
+ }
4373
4392
  function splitRecipients(s) {
4374
4393
  const raw = [];
4375
4394
  let cur = "", inQuote = false;