Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Autocomplete library #204

Open
parttimenerd opened this issue Mar 7, 2021 · 7 comments
Open

Replace Autocomplete library #204

parttimenerd opened this issue Mar 7, 2021 · 7 comments

Comments

@parttimenerd
Copy link
Contributor

Replace the library used for autocompletions, as it currently doesn't support:

  • validation
  • required attribute

We can either replace it fully or create a fork. And we could think about adding all streets of Karlsruhe (https://github.com/CodeforKarlsruhe/streetnames) and other information to the autocompletions. A basic validation could also be useful (e.g. for e-mail addresses).

@daniel17903
Copy link
Contributor

If there is another library supporting all required features we can replace it. If not I suggest that we implement these two features by referencing the input element of the current AutocompleteInput directly. Because imho it's not worth it to write or maintain a lot of additional code ourselves just for these two features.

For the street names I really like our current solution which uses the streets that already exist in our database for autocompletion.

Basic validation for mail addresses would be great.

@parttimenerd
Copy link
Contributor Author

parttimenerd commented Mar 8, 2021

If there is another library supporting all required features we can replace it.

Sadly, there seems to be none.

If not I suggest that we implement these two features by referencing the input element of the current AutocompleteInput directly. Because imho it's not worth it to write or maintain a lot of additional code ourselves just for these two features.

You're right. I'm going to look into that (but probably with a separate, small PR).

For the street names I really like our current solution which uses the streets that already exist in our database for autocompletion.

May I ask why?

@skjerns
Copy link
Member

skjerns commented Mar 8, 2021

For the street names I really like our current solution which uses the streets that already exist in our database for autocompletion.

May I ask why?

This makes it more flexible when porting it to other cities. Alternative would be to include a list of all streets of a pre-selected city. But we decided to just suggest street names that are already in the db, as else we would need to add said list to the db. as there is no backend this would mean loading this list(part) every time we load the application, or adding it to the couchdb, which again would make it more difficult to port to other cities

@parttimenerd
Copy link
Contributor Author

We could also use a resource file, that is only loaded for this particular form? It would decrease the possibility of typos.

@skjerns
Copy link
Member

skjerns commented Mar 8, 2021

Yes sure. We just need to make sure it's easily portable to other cities without people having to adjust anything manually within files. I would assume not all leihläden in Germany have someone at hand that can easily scrape a list of street names for their given city

@daniel17903
Copy link
Contributor

daniel17903 commented Mar 8, 2021

For the street names I really like our current solution which uses the streets that already exist in our database for autocompletion.

May I ask why?

  • As skjerns said it's portable without any effort
  • We do not need to maintain and load a large list of streets
  • The loading and searching of a large list of streets in the frontend might be slow. When using a resource file we would have to search it in the frontend. Only if we store the streets in the database we could search in the backend as we do with the current solution.
  • In my opinion improving this autocomplete feature a little bit is not something that has great value for the user. I think we should invest our time in building more other features / improvements.
  • It might be an overkill to load all streets of Karlsruhe because most customers live in a smaller area around the leihlokal (just guessing).

To see how well the current solution works it might be interesting to generate a statistic about how often a user wants to enter a street which is not in the database yet.

@parttimenerd
Copy link
Contributor Author

Thanks for the clarification. I keep this issue open until I or someone else implemented the validation and required attribute, as both should increase the usability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants