-
Notifications
You must be signed in to change notification settings - Fork 49
AppSideNav
: fix scrolling issue and being able to focus hidden links issue
#2869
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5405641
fix: dont lock scrolling on desktop
f99562e
chore: changeset
696be6f
fix: re-enable body test for Modal
d5c7db5
fix: prevent users from tabbing to hidden links if dont use portal
2df7b3e
chore: add tests for the bugs fixed
c6e5edd
chore: update changeset
6af08bc
fix: issue where pressing escape doesnt reset ability to scroll
6b4ba9c
fix: failing test
1adbcbd
Update .changeset/honest-experts-battle.md
shleewhite 800bdb9
chore: rename class hds-app-side-nav-hide-when-minimized -> hds-app-s…
8dd5c5b
chore: remove content from docs that isnt true
ffb7563
chore: refactor how content is marked as inert
d0f4983
chore: typo
45d098d
Update showcase/tests/integration/components/hds/app-side-nav/index-t…
shleewhite f479157
chore: remove unneeded content inside AppSideNav tests
0e325c6
chore: remove unneeded arg in test
345c550
fix: use custom modifiers instead of did-insert
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hashicorp/design-system-components": patch | ||
--- | ||
|
||
`AppSideNav` - Fixed bug where scrolling was blocked when the `AppSideNav` was expanded on desktop views. Also fixed bug which allowed user to focus links that were visually hidden. |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,19 +201,15 @@ Each one of these states has CSS class names associated, and they’re used by t | |
|
||
The App Side Nav component **automatically**: | ||
|
||
- fades in/out the “actions” block in the header and the content injected in the body via “portals”. | ||
- fades in/out the content in the navigation | ||
- swaps the toggle button icon from “menu” to “close” and moves it from one position to another | ||
|
||
Any other content in the App Side Nav needs to be **explicitly handled** by the consumers (in this way they have full control of the content they add, and they can customize the transition as they want/need). | ||
|
||
One possible way to do it is to use the **`hds-app-side-nav-hide-when-minimized` class**. This is a special class that can be applied to a DOM element so that it **automatically** fades in/out when the App Side Nav changes its “minimization” state. | ||
|
||
More specifically: | ||
More specifically, the animation is: | ||
|
||
- `minimized → maximized` transition: the content appears with a fade-in effect, when the width animation is already completed (the width is maximized) | ||
- `maximized → minimized` transition: the content disappears at once with no transition, before the width animation starts | ||
|
||
Another option is to use the **`isMinimized` parameter**, which is useful in those cases where the content is so custom/specialized that it can’t just be faded in/out but needs to have a different kind of transition (eg. remain visible but change layout or respond to the width of the container). This value is passed down by the `<:header/body/footer>` named blocks as parameters, and can be used to build custom logic on the consumers’ side. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The component doesn't return named blocks or the |
||
Any other content in the App Side Nav needs to be **explicitly handled** by the consumers (in this way they have full control of the content they add, and they can customize the transition as they want/need). | ||
|
||
#### Advanced customization | ||
|
||
|
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.
Uh oh!
There was an error while loading. Please reload this page.