fix: Hide/show nav keyboard nav bug#1275
Merged
elnelson575 merged 20 commits intomainfrom Jan 20, 2026
Merged
Conversation
This reverts commit 1c671e5.
Removed unnecessary comment about Bootstrap documentation.
gadenbuie
reviewed
Jan 14, 2026
Member
gadenbuie
left a comment
There was a problem hiding this comment.
Looking good, just a few more details to wrap up
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
…to fix/hidden-navs
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
…to fix/hidden-navs
gadenbuie
reviewed
Jan 15, 2026
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
When there is a
nav_panel_hidden()item in anavset_pill_list(), once the spot where it would be if it was visible is hit with keyboard navigation (ex. if you have Tab 1, Hidden Tab 2, Tab 3, after you press an arrow or tab after Tab 1), extra space is added in the<ul>well and the content of the hidden tab is shown, while the nav panel loses focus.Problem:
This essentially breaks the nav for users navigating via the keyboard, because they both lose focus unexpectedly and end up in content that they shouldn't.
Cause:
nav_panel_hidden()creates tabs withtitle=NULLand removes the padding via CSS. TheliTag()function renders the<li>elements, but they are marked hidden.However, Bootstrap 5's keyboard navigation uses the
.nav-linkclass to find navigable tabs and hidden tabs still have this class, even though they are hidden.Status:
Adding the disabled attribute and a CSS class to hide based on that does work to eliminate the initial issue (keyboard users can no longer stumble upon it, there is no awkward gap.
It does not affect the behavior if
nav_select()ornav_show()-- the tab content will be shown.BS5:
https://github.com/user-attachments/assets/dd0057c0-5ea8-4788-a3d5-3c608f97a268
BS4:
https://github.com/user-attachments/assets/cf0b0afd-a8eb-4376-9a8a-955ea647560c
BS3:
https://github.com/user-attachments/assets/f4009a29-ec4b-48c4-a797-20a12420c5b4
App Code
Commented portion is BS5 only, so tested only in that version.To do:
Check if this is a problem elsewhere (ex. vanilla shiny) and/or in pyshiny as well.