Skip to content
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(top-nav): allow consumers to "ignore-url-parts" or "search" or "hash" #3923

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

Westbrook
Copy link
Contributor

Description

Add ignore-url-parts attribute and ignoreURLParts property that accept a space separated list of things to remove from the URL when comparing for the "selected" item in a Top Nav. Values of hash and search are currently supported.

This makes it so that consumers can opt-in to which part of the URL they would like their "selected" Top Nav Item to be matched against.

Related issue(s)

How has this been tested?

  • Test case 1
    1. Go here
    2. See that the selected item in the Top Nav does not include the search params in its href.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

github-actions bot commented Jan 6, 2024

Tachometer results

Chrome

top-nav permalink

Version Bytes Avg Time vs remote vs branch
npm latest 431 kB 85.94ms - 89.97ms - unsure 🔍
-3% - +2%
-2.63ms - +1.78ms
branch 424 kB 87.48ms - 89.29ms unsure 🔍
-2% - +3%
-1.78ms - +2.63ms
-
Firefox

top-nav permalink

Version Bytes Avg Time vs remote vs branch
npm latest 431 kB 138.21ms - 145.83ms - unsure 🔍
-3% - +6%
-3.78ms - +8.02ms
branch 424 kB 135.40ms - 144.40ms unsure 🔍
-6% - +3%
-8.02ms - +3.78ms
-

Copy link
Collaborator

@najikahalsema najikahalsema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this.

@najikahalsema najikahalsema merged commit 83bf70b into main Jan 8, 2024
47 checks passed
@najikahalsema najikahalsema deleted the top-nav-search branch January 8, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: <sp-top-nav-item> isn’t selected when URL parameters are present
2 participants