Skip to content

Commit a5f3226

Browse files
authored
fix: use { force: true } on privacy setting radio inputs to prevent click interception (#583)
1 parent 40321e1 commit a5f3226

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/core/src/linkedinPrivacySettings.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,14 @@ async function applyProfileViewingMode(
482482
);
483483

484484
if (explicitOption) {
485-
await explicitOption.locator.click({ timeout: 5_000 });
485+
await explicitOption.locator.click({ timeout: 5_000, force: true });
486486
} else {
487487
const fallbackIndex = PROFILE_VIEWING_MODE_VALUE_ORDER.indexOf(targetValue);
488488
const roleRadios = page.locator(
489489
"main [role='radio'], [role='main'] [role='radio'], form [role='radio']"
490490
);
491491
if ((await roleRadios.count()) >= PROFILE_VIEWING_MODE_VALUE_ORDER.length) {
492-
await roleRadios.nth(fallbackIndex).click({ timeout: 5_000 });
492+
await roleRadios.nth(fallbackIndex).click({ timeout: 5_000, force: true });
493493
} else {
494494
const fallbackLabels = page.locator(
495495
"main label, [role='main'] label, form label"
@@ -506,7 +506,7 @@ async function applyProfileViewingMode(
506506
);
507507
}
508508

509-
await fallbackLabels.nth(fallbackIndex).click({ timeout: 5_000 });
509+
await fallbackLabels.nth(fallbackIndex).click({ timeout: 5_000, force: true });
510510
}
511511
}
512512

@@ -625,23 +625,23 @@ async function clickBinaryRadioOption(
625625
"main input[type='radio'], [role='main'] input[type='radio'], form input[type='radio']"
626626
);
627627
if ((await radioInputs.count()) >= optionCount) {
628-
await radioInputs.nth(targetIndex).check({ timeout: 5_000 });
628+
await radioInputs.nth(targetIndex).check({ timeout: 5_000, force: true });
629629
return `${settingKey}-radio-input-index-${targetIndex}`;
630630
}
631631

632632
const roleRadios = page.locator(
633633
"main [role='radio'], [role='main'] [role='radio'], form [role='radio']"
634634
);
635635
if ((await roleRadios.count()) >= optionCount) {
636-
await roleRadios.nth(targetIndex).click({ timeout: 5_000 });
636+
await roleRadios.nth(targetIndex).click({ timeout: 5_000, force: true });
637637
return `${settingKey}-role-radio-index-${targetIndex}`;
638638
}
639639

640640
const fallbackLabels = page.locator(
641641
"main label, [role='main'] label, form label"
642642
);
643643
if ((await fallbackLabels.count()) > targetIndex) {
644-
await fallbackLabels.nth(targetIndex).click({ timeout: 5_000 });
644+
await fallbackLabels.nth(targetIndex).click({ timeout: 5_000, force: true });
645645
return `${settingKey}-label-index-${targetIndex}`;
646646
}
647647

@@ -650,7 +650,7 @@ async function clickBinaryRadioOption(
650650
createToggleControlCandidates()
651651
);
652652
if (toggle) {
653-
await toggle.locator.click({ timeout: 5_000 });
653+
await toggle.locator.click({ timeout: 5_000, force: true });
654654
return `${settingKey}-toggle-fallback:${toggle.key}`;
655655
}
656656

0 commit comments

Comments
 (0)