josephfrazier / reported-web

Web front-end for https://twitter.com/Reported_NYC: https://reported-web.herokuapp.com
https://reported-web.herokuapp.com
MIT License
10 stars 1 forks source link

Use datalist for license state so users can type their own in while still having the autocomplete options #552

Open josephfrazier opened 4 days ago

josephfrazier commented 4 days ago

See email titled "Re: Glitches": https://mail.google.com/mail/u/0/#sent/FMfcgzQXJkQzKQxDrvjxTNhzNfHSVLCS

I very much appreciate that the app allows me to write in the license-plate state; the web site offers a list of the 50 states and DC, which is fine when it's not the odd Canadian or federal-government-fleet plate

Great point! I'll see if I can make it so that you can type your own state if you'd like, while still having the existing list to easily pick from, using a datalist. I'll try to keep you posted!

The <input> element syntax was adapted from the preceding plate field.

I don't know why I had the licenseState = licenseState || this.state.licenseState line in the setLicensePlate function, but it made it so that you can't delete all the characters from the field, so I removed it. It was added in commit 0198474a9193a6b668a2f58fd224f98819d40f4e, but I didn't write down why I added it.