Re-enable autofill on add new book form
At some point it seems auto-fill was disabled on the title field of the add new book form. It's quite handy when adding books from a series that have similar titles with small variations. Please re-enable.
Evidence / Screenshot (if possible)
Relevant url?
https://openlibrary.org/books/add
Steps to Reproduce
- Go to ...the title field and start typing the title of a book already entered.
- Do ...notice there is no auto-fill activated.
- Actual:no auto-fill
- Expected: auto-fill should recognise previously entered text and populate the field
Details
- Logged in (Y/N)?
- Browser type/version?
- Operating system?
- Environment (prod/dev/local)? prod
Proposal & Constraints
Related files
Stakeholders
@jimchamp
@seabelis can I please take on this issue? Thank you!
@seabelis, so I understand, do you mean that the Browser's autofill feature (e.g. when google chrome suggests an autocomplete based on previous things you've entered) has been disabled for this page?
@XiyueJasmineZhang is this also your understanding of the problem? If so, can you share your proposed solution?
@cdrini tried to reproduce and is able to get browser autofill recommendations 🤔
@XiyueJasmineZhang is this also your understanding of the problem? If so, can you share your proposed solution?
Hi! XiyueJasmineZhang is my school github account but I submitted the PR under this account. My understanding was that of the fields that needs to be filled on the Add a Book page: https://openlibrary.org/books/add, the "Title" field doesn't give autofill recommendations.
@mekarpeles Yes. The publisher and date fields do auto-fill; the title field no longer auto-fills.
Some more details:
- Browser autofill for the title field is working as expected in Firefox
- Autofill is confirmed broken in Chrome and Brave browsers.
- Suspect that the same is true for all Chromium-based browsers.
- Unsure about Safari (@mekarpeles, could you check?)
- Changing the
nameattribute of the title input fromtitletotitle-fieldcaused autofill to work again in Chrome.- Tested this by doing the following (with Chrome):
- Changed
nameattribute in my local instance. - Added a book to my local instance.
- Loaded the production add book page.
- Modified the title input's
namefield using devtools. Auto fill worked after the name was changed.
- Changed
- Tested this by doing the following (with Chrome):
As a quick fix, we could change the name of this field. Then, in the handler, set i.title equal to the new value here (this will prevent having to make a ton of changes throughout the add book flow). Whoever does this will have to make sure that the change doesn't break existing front-end validation on the title field.
I would like to on this issue assign me!
@shivam200446 are you still working on this?
@jimchamp Yes Sir, Working on it. Please elaborate more on the issue. I am just being confused with all above conversations.
Sure. In the future, please ask questions if you have doubts.
- Update the "Add book" template, here. Autofill is not working for inputs that have
titleas thename, so these will need to be updated. You can usebook_titleas the newname. - The POST handler for the add book form is here. The expected form inputs and their default values are defined here. Add
book_title=""to this object. Then, set the value ofi.titletoi.book_title.
Sure. In the future, please ask questions if you have doubts.
- Update the "Add book" template, here. Autofill is not working for inputs that have
titleas thename, so these will need to be updated. You can usebook_titleas the newname.- The POST handler for the add book form is here. The expected form inputs and their default values are defined here. Add
book_title=""to this object. Then, set the value ofi.titletoi.book_title.
Okay! Thank You so much