Open tloubrieu-jpl opened 3 years ago
@tloubrieu-jpl In short there is no super simple way to do this using React and Material-UI. The first reason is that Material-UI turns off the browser's auto fill automatically due to rendering issues. Secondly, each browser supports it's own auto fill values but not custom ones. For example Chrome saves payment information, addresses and passwords only. Safari and Firefox are similar. Internet Explorer attempts to save the entire form but we don't support IE. The third reason is that these values get saved on submission of a form on a normal HTML page but we are using AJAX requests so there would have to be a workaround to get the browser to save the values.
There are alternatives including many hacky solutions but they are probably not worth it since we are only trying to save 2 fields. For example one alternative is to use a third party plugin that saves the values of a form and adds them back later, however this might lower our usability as anyone using this app will probably not want to use a third party plugin.
Another alternative would be to save any submission values in the browser's local data storage so that when they return to the app it can be loaded into autocomplete widgets for the form. This would be the simplest good solution but it is probably not worth it since it would take some time to get this set up and tested. It might not be worth it for just 2 fields.
Thanks Eddie for the detailed answer. This is indeed not critical but that would help the user a lot.
Anyway ticket #17 priority is higher so you can work on it first.
One last question, is the third alternative (save any submission values in the browser's local data storage) related to cookies management as discussed there https://stackoverflow.com/questions/39826992/how-can-i-set-a-cookie-in-react
If yes, I can confirm that would be my preferred solution also.
@tloubrieu-jpl Yes cookies are usually used as a backup for local storage but we can use only cookies to store this information to make this easier and simpler. It would also be my preferred solution when we get back to this.
The user are likely to use exactly the same inputs always here.
The should be done only if there is a simple way to do so with react.