Please, add option to trigger "onChange" and "Click" events

1,241 views
Skip to first unread message

giorgi darbaidze

unread,
Jun 10, 2021, 9:31:45 AM6/10/21
to Autofill Chrome Extension
Hello.

This plugin is generally awesome, but useless in certain cases.
I am using react-use-form plugin for forms validation and the plugins "thinks" that the fields are empty, because it listens for "change" event on the field.

So, please, add an option in settings to enable event triggers.

Another similar plugin has a such option in settings, 
called "Trigger click/change events on input fields" and it works with it enabled.

Thank you

Igor Ensemble

unread,
Jun 10, 2021, 2:10:39 PM6/10/21
to Autofill Chrome Extension
Hello, 

I'd like to second that. 
But, your work is much better & flexible.
Please, add this future or suggest a workaround.

Thank you

Igor Ensemble

unread,
Jun 10, 2021, 8:26:17 PM6/10/21
to Autofill Chrome Extension
here is a workaround:

var name = document.querySelectorAll('[aria-label="First Name"]')[0];
name.value = 'Jane';
name.dispatchEvent(new Event('input'));
["input", "click", "change", "blur"].forEach((event) => {
  const changeEvent = new Event(event, { bubbles: true, cancelable: true });
  name.dispatchEvent(changeEvent);
});

giorgi darbaidze

unread,
Jun 11, 2021, 5:32:20 AM6/11/21
to Autofill Chrome Extension
"Fake Filler" is a good plugin, but, i don't like the fact that it doesn't allow to fill form with custom data( or, maybe i didn't find such functionality).
Thank you for solution very much Igor, i'm using "User JavaScript and CSS" to run your code for all inputs on page when hotkey(ctrl  + shift + mouse key) pressed and it works.
Before introducing this feature into an extension, i think this is the only option.

Autofill Chrome Extension

unread,
Jun 13, 2021, 6:16:33 PM6/13/21
to Autofill Chrome Extension
Autofill does trigger a chain of events that simulate a human being (keydown', 'keypress', 'input', 'keyup', 'change' -- in this order).

It's possible that something else is going on, or a newly discovered bug with React forms. If you provide URL to the form and steps to reproduce issue, I can try to fix it.

giorgi darbaidze

unread,
Jun 18, 2021, 3:51:03 AM6/18/21
to Autofill Chrome Extension
You are right, i checked it out one more time, but on sandbox, with same code and it works, but it doesn't work in my real project.
The code and plugins on sandbox is the same as in my project.
This is strange.
I have many extensions in chrome, including similar ones as "Autofill", maybe there is a conflict between plugins, i will check.
Reply all
Reply to author
Forward
0 new messages