Skip to content

Commit b67d04b

Browse files
committed
fix: blur input even if the input was already autofilled, to force close keyboard
1 parent 0d6b1d7 commit b67d04b

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

dist/autofill-debug.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/autofill.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Form/Form.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,11 @@ class Form {
887887

888888
if (this.shouldSkipInput(input, dataType)) return;
889889

890-
// If the value is already there, just return
891-
if (input.value === string) return;
890+
// If the value is already filled, blur and return. We nede to blur to force closing the keyboard in some cases (e.g credit cards)
891+
if (input.value === string) {
892+
input.blur();
893+
return;
894+
}
892895

893896
const successful = setValue(input, string, this.device.globalConfig);
894897

src/UI/controllers/NativeUIController.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class NativeUIController extends UIController {
7575
form.activeInput?.focus();
7676
break;
7777
}
78+
7879
case 'acceptGeneratedPassword': {
7980
form.autofillData(
8081
{

0 commit comments

Comments
 (0)