-
Notifications
You must be signed in to change notification settings - Fork 13
Hitting Enter uses the default search page #40
Comments
This is the default behavior as of now. I think it will be okay to mention this in docs? |
I think we should select the first result, so when pressing enter the user can go to the page of that result. |
@stsewd |
When searching, the popup window should have the first result selected, so when hitting enter, the user goes to the first result. No need to use arrow keys, tab or the mouse to select the first result. edit: looks like is only possible to navigate the results with tab |
@stsewd Also, it is possible to select the results with the ArrowUp and ArrowDown keys. |
Sorry, I had an extension overriding that. |
I would like to know what will be good UI. |
Normal search function is to perform a search when hitting enter in a search box, we should preserve this. I expect that the search modal results will be updated when I hit enter. I don't expect to be dropped back into the default sphinx search results. |
@agjohnson |
I'm fixing this in #81. The idea, is to select the first result, but have a link to the original search, this also helps in the case the api is down, so users can still go to the default search. |
Sure, but they are, myself included 🙂 If the goal is to block the user from hitting enter, then we should capture this keypress and stop the event from propagating. It is unexpected UX to hit enter, whether accidentally or because you're used to text boxes accepting enter keypress as an action, and being dropped into a different UI.
@stsewd I think blocking the event from propagating/default event is fine. We just don't want to drop the user on the search.html page, I would be surprised to select the first search result automatically. |
But having enter do nothing feels weird, having the first item selected by default, so you can use enter to go the page is used by several applications (slack, algolia). |
I'd expect that when hitting Enter,
I'm not 100% sure that we want to select the first result by default. I think it's confusing because if you type something, and hit enter, but milliseconds before you hit enter there were results you will end up in a page that you don't know why (the first result was clicked without notice it) |
we are talking about the "search as you type" extension, so it is expected that you don't need to hit enter to search for something. We could change the placeholder to be more explicit like "type to start searching", even in the browser the first item is selected automatically |
That's the intended user interaction, but the effective user interaction is going to vary based on the user. We can avoid discrepancies between how people interpret an search as you type input box by making the interaction consistent. Myself, when I see a text box input like this, I assume I'm supposed to hit enter at the end to update the search results. If you don't interpret a search input like this, then you wouldn't press enter. Both users would have the same experience if we make enter update the search results.
It wouldn't technically be doing nothing, but instead hitting enter could move focus away from the text input box, or could simple trigger a search event (similar to pausing typing), or both. I don't think we need an opinionated event here, but hitting enter needs to provide the user with some feedback. |
I'm closing this because the new "Search addon" won't trigger the "default search" since it knows nothing about it. So, my original problem is solved. Feel free to open a new issue in https://github.com/readthedocs/readthedocs-client/ if you think there are more things to discuss related to this topic. |
Steps to reproduce it
configuration
Actual result
You are redirected to https://docs.readthedocs.io/en/latest/search.html?q=configuration&check_keywords=yes&area=default which is the default search (instead of the Search As You Type)
Expected result
I was expecting that it will just send the current query to the backend and do nothing, basically.
In case we want to have a fallback to the default search result, I think the usage of Enter has to be communicated in the UI.
The text was updated successfully, but these errors were encountered: