Skip to content

Commit 0d0d804

Browse files
committed
fix: only apply to applicable inputs
1 parent 2e1d999 commit 0d0d804

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

dist/autofill-debug.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/autofill.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Form/Form.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,18 @@ class Form {
818818
// Don't open the tooltip on input focus whenever it's showing in-context signup
819819
if (isIncontextSignupAvailable) return false;
820820

821-
const wasAnyCCFieldTouched = [...this.inputs.creditCards].some((input) => this.touched.has(input));
822-
return isMobileApp && !wasAnyCCFieldTouched && (canShowCCIcon(subtype) || subtype === 'cardName');
821+
const isEligibleCCField = (ccSubtype) => canShowCCIcon(ccSubtype) || ccSubtype === 'cardName';
822+
823+
const isTouchedCCInput = (ccInput) => {
824+
const ccSubtype = getInputSubtype(ccInput);
825+
return this.touched.has(ccInput) && isEligibleCCField(ccSubtype);
826+
};
827+
828+
const hasAnyTouchedCCInput = [...this.inputs.creditCards].some(isTouchedCCInput);
829+
830+
console.log('isMobileApp, isEligibleCCField(subtype)', isMobileApp, isEligibleCCField(subtype), !hasAnyTouchedCCInput);
831+
832+
if (isMobileApp && isEligibleCCField(subtype)) return !hasAnyTouchedCCInput;
823833
}
824834

825835
return !this.touched.has(input) && !input.classList.contains('ddg-autofilled');

0 commit comments

Comments
 (0)