fix: react-doctor modal/dialog/dropzone a11y — 18 files to role+tabIndex+onKeyDown or dialog
This commit is contained in:
@@ -228,6 +228,8 @@ export default function ContactImportForm({ brandId }: { brandId: string }) {
|
||||
const seenEmails = new Set<string>();
|
||||
const seenPhones = new Set<string>();
|
||||
const entries: ContactImportEntry[] = [];
|
||||
const headerIndex = new Map<string, number>();
|
||||
headers.forEach((h, i) => headerIndex.set(h, i));
|
||||
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
const row = rows[i];
|
||||
@@ -235,8 +237,8 @@ export default function ContactImportForm({ brandId }: { brandId: string }) {
|
||||
const ignored: Record<string, string> = {};
|
||||
|
||||
for (const mapping of effective) {
|
||||
const colIdx = headers.indexOf(mapping.csvColumn);
|
||||
if (colIdx === -1) continue;
|
||||
const colIdx = headerIndex.get(mapping.csvColumn);
|
||||
if (colIdx === undefined) continue;
|
||||
const raw = row[colIdx] ?? "";
|
||||
|
||||
if (mapping.field === null) {
|
||||
@@ -266,7 +268,10 @@ export default function ContactImportForm({ brandId }: { brandId: string }) {
|
||||
break;
|
||||
case "tags":
|
||||
entry.tags = raw
|
||||
? raw.split(/[;:,]/).map((t) => t.trim()).filter(Boolean)
|
||||
? raw.split(/[;:,]/).flatMap((t) => {
|
||||
const trimmed = t.trim();
|
||||
return trimmed ? [trimmed] : [];
|
||||
})
|
||||
: undefined;
|
||||
break;
|
||||
case "email_opt_in":
|
||||
|
||||
Reference in New Issue
Block a user