Skip to content

fix get navItem object bug by Navigation.get(target) method. #1410

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NameHitherto
Copy link

When I want to use the get(target: string) method in navigation.js to get the target navItem I encountered a bug, the method provides two means of querying based on the id or href attributes of the navItem, when I need to query based on the id I need to manually add the # character, while at this time the target is no longer equal to the id value of the target navItem. So I restore the target value after the determination is over:

if(target.indexOf("#") === 0) {

and before calling getByIndex:
return this.getByIndex(target, index, this.toc);

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.

1 participant