freeCodeCamp / freeCodeCamp/devdocs

Don't switch to a different layout when window is too narrow

Đang mở
#1,100 7 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Ruby
Star
39.5k
Fork
2.6k
Merge trung bình
4 ngày 32 phút
Pull request đã merge (30 ngày)
13

Mô tả

When the browser window is too narrow (or the browser zoom too high), devdocs switches to a different layout, where the search bar stretches horizontally across the entire screen, the sidebar is hidden by default and it shows up to fill the whole screen when you start typing in the search box.

This, by itself, doesn't sound too bad. However, there are two weird changes in the UI behavior that make this layout less convenient to use than the normal one. Also, the standard layout already includes the option to automatically hide the sidebar, so this seems completely superfluous.

I suggest removing this feature.

The two annoyances mentioned above are:

1. In normal layout, when I type in the search box, the first entry in the sidebar is automatically focused, so I can press enter at any time to display it in the documentation area. In the compact layout, the top entry isn't focused, so to display the doc entry at the top of the list, I have to press the down arrow key to select it and only after that press enter.

2. It's impossible to select the doc entry that's already displayed. This might sound like a weird thing to complain about, but consider the following scenario: I typed stdvec (and did the down-arrow + enter dance) to display documentation for C++ std::vector. I then accidentally pressed g so the search box now contains stdvecg and the search menu pops up to fill the screen and obscure my view. I backspace to remove the g and try to reselect the entry for std::vector but it doesn't work, either through pressing enter or mouse-clicking on it. So the search menu is stuck and I have to either click the hamburger button in the top left corner to hide it or select another documentation entry and then go back to std::vector.
In normal layout with sidebar auto-hiding turned on this works much better. I can just press enter and the sidebar disappears.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.