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

Make the search form more clear to understand #31

Closed
subins2000 opened this issue Oct 22, 2023 · 1 comment
Closed

Make the search form more clear to understand #31

subins2000 opened this issue Oct 22, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@subins2000
Copy link
Collaborator

https://github.com/knadh/dictpress/blob/master/site/static/main.js#L16C1-L17C1

.replace(/[^a-z\u00E0-\u00FC\s]/ig, '')

This regex replace is unnecessary for a default example template. I was confused why the search was not working and ending up in a HTTP authentication required page.

The form didn't look like it had a JS backing. One more suggestion is to remove the name attribute from the search form so that it is more clear. Why need a name if the form submission is actually handled by JS.

@subins2000 subins2000 self-assigned this Oct 22, 2023
@knadh
Copy link
Owner

knadh commented Oct 23, 2023

Ah, I think that's there to remove the zwnj characters. True, needn't be in the default search, but ideally, it shouldn't break anything because zwnj is used in so few languages out there anyway. Can you share the examples that broke?

It's a good practice (semantics) to have a name param for inputs, irrespective of whether they're handled by JS or not. Here, if I recall correctly, even if JS is disabled, the form submission should gracefully degrade to GET ?q=xxx and still work.

@knadh knadh added the question Further information is requested label Oct 23, 2023
@knadh knadh closed this as completed in 29ac487 Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants