question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single-line text fields do not work with auto-filled form fields

See original GitHub issue
screen shot 2016-10-06 at 11 43 39 am

I tried detecting this via change events which didn’t work. I also tried checking for value on init but that only worked for non-password inputs and was non-deterministic in terms of its timing.

Possible workarounds:

Style for :autofill

This is clearly the most elegant solution, but looks like it’s Chrome only

Have elements poll to check if they’re auto-filled

This will lead to the highest design fidelity, but is extremely inefficient and will incur a significant performance impact, especially on mobile browsers.

Tell users to set autocomplete="off"

This would in theory solve the problem. However, it is not only an inconvenience to the user, but it’s not guaranteed to work correctly for all types of input.

Tell users to only use JS-enhanced single-line inputs with form fields that won’t be auto-completed

😢

Copied from https://github.com/google/material-design-lite/issues/4827


  • Summarize research on how most browsers handle auto-filling and present best solution
  • Implement solution

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ranjeet-choudharycommented, Jul 23, 2018

@amsheehan is this fixed? i’m still getting this issue with autocomplete data

0reactions
amsheehancommented, Jan 17, 2017

@traviskaufman After looking at the responses from the implementors of Firefox and Chrome regarding the issue of input elements not firing events for programmatic assignments of values, I don’t think we should necessarily try to force this. They seem content that since the behavior is not in the standard, that inputs should not behave this way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autofill populating wrong fields - Stack Overflow
It just wanted to fill any kind of field (select or input) as long it was not readonly (with complete no respect for...
Read more >
Auto-populate form fields with a query string
Learn how to auto-populate field values in a form on a page by adding query strings to the page URL.
Read more >
Autofill - web.dev
One way to help users fill out forms faster is by offering them the option to automatically fill in form fields with previously...
Read more >
How to autopopulate the single line text field fro... - ServiceNow
I tried with the following 2 scripts but still its not working. Plz hlp me with this . script 1:- function onChange(control, oldValue,...
Read more >
Disabling Safari AutoFill for a single line address input
Currently, no browser AutoFill can neatly concatenate multiple address pieces into a single input. However, the solution for these browsers is more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found