-
Notifications
You must be signed in to change notification settings - Fork 327
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
FIX - Two small bug fixes to search-as-you-type #2111
base: main
Are you sure you want to change the base?
Conversation
- Clear lastQuery when query is cleared - Apply height to dialog only when search results are not empty
Testing on https://pydata-sphinx-theme--2111.org.readthedocs.build/en/2111/ (this PR) and https://pydata-sphinx-theme.readthedocs.io/en/latest/index.html (main) I'm a bit confused about what is getting fixed here / what the behavior should be.
So 2.i and 2.ii are different behavior between Separately, I find it a bit odd that neither |
So the problem is about the part of the backdrop that is BELOW the search bar. Steps to reproduce:
The reason why #2093 introduced this bug is straightforward. It made the height of the search dialog 80vh to accommodate the search-as-you-type results. But most of that 80vh is just empty until populated with search results. It's just a tall container with a skinny search bar at the very top. But the rest of the container is transparent, allowing the user to see through to the inert/grayed-out page beneath the dialog. And if you click in that space, it looks like you're clicking the page underneath, but you're actually clicking on transparent space of the dialog itself and so it doesn't go away. As for discrepancies in clearing the search results, I can only reproduce 2.i (escape key clears results but not query) in Firefox. I could see 2.i causing usability problems but not 2.ii, so I say we take the path of least resistance to one of the following:
The mixed state is the problematic one for me. We should never clear the results but keep the query, nor should we clear the query but keep the results (unless we change the UI at some point in the future to show some kind of default results when the query is empty - for example, Algolia will show results from your past queries when you open the search modal - but for a search-as-you-type UX, I would argue that having some default in the results area makes the UX less intuitive because it's slightly harder to use inductive reasoning to make the connection between the content in the search box and the content below, since there's an exception, i.e., shouldn't empty box equal empty results?). |
@@ -86,10 +86,10 @@ | |||
margin: 15vh auto 0; // an open modal dialog has a fixed position, so these margins bring it 15% down the viewport height and center it horizontally | |||
width: 90%; | |||
max-width: 800px; | |||
max-height: 80vh; // when we display search-as-you-type results in the modal, it needs to be able to expand in height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know why I didn't see this the first time around, but yeah, the simple solution is to apply a max-height on the search dialog, not to toggle a height class 🙈
Ah, ok, I did indeed misunderstand. Pretty sure I was clicking off to the side
I'll try to make a video of 2.ii later today when I'm at my desk
Agreed. I'd vote for always clearing both results and query |
I found two bugs when I was looking at the new search-as-you-type feature: