Skip to content

Commit 3a954f0

Browse files
committed
fix: only apply to applicable inputs
1 parent 2e1d999 commit 3a954f0

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

dist/autofill-debug.js

Lines changed: 6 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: 6 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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,18 @@ class Form {
813813
}
814814
}
815815

816+
const isTouchedCCInput = (input) => {
817+
const subtype = getInputSubtype(input);
818+
return this.touched.has(input) && (canShowCCIcon(subtype) || subtype === 'cardName');
819+
};
820+
816821
const isMobileApp = this.device.globalConfig.isMobileApp;
817822
if (this.device.globalConfig.isExtension || isMobileApp) {
818823
// Don't open the tooltip on input focus whenever it's showing in-context signup
819824
if (isIncontextSignupAvailable) return false;
820825

821-
const wasAnyCCFieldTouched = [...this.inputs.creditCards].some((input) => this.touched.has(input));
822-
return isMobileApp && !wasAnyCCFieldTouched && (canShowCCIcon(subtype) || subtype === 'cardName');
826+
const hasAnyTouchedCCInput = [...this.inputs.creditCards].some(isTouchedCCInput);
827+
return isMobileApp && !hasAnyTouchedCCInput;
823828
}
824829

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

0 commit comments

Comments
 (0)