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

Child breadcrumb with empty path is ignored and replaces parent #44

Closed
chad-smith opened this issue Sep 4, 2020 · 5 comments · Fixed by #45
Closed

Child breadcrumb with empty path is ignored and replaces parent #44

chad-smith opened this issue Sep 4, 2020 · 5 comments · Fixed by #45
Labels
bug Something isn't working

Comments

@chad-smith
Copy link

I have found some odd behaviour when defining empty paths, it's quite fiddly to explain in text, so I have altered the demo site to reproduce my findings.

If you apply the changes in chad-smith/xng-breadcrumb@master...demo-data-bug you will find that neither of the breadcrumbs being set are used.

After a bit of poking around, I found the following:

  1. Removing the root data: { breadcrumb: ...} makes no difference
  2. Removing the module data: { breadcrumb: ...} resolves the issue
  3. Removing the breadcrumb label but keeping the data: {}_ in the module causes the issue!

Scenario 3 is why the project I'm using breadcrumbs on has been seeing the problem (we use the data attributes frequently for permissions).

NB: If you deviate from an empty path, you will see both breadcrumbs as expected.

I thought this might be related to #25 because using the 'hack' that was described there also seems to work.

@chad-smith chad-smith added the bug Something isn't working label Sep 4, 2020
@chad-smith
Copy link
Author

To make this a little more visual, with the code changes referenced, I see this:

image

And I am expecting to see this:

image

Whilst prepping those screenshots, I noticed that whilst I could get it to display Mentee (Root), I couldn't get it to display Mentee (Module) (the above screenshot is faked).

Either value would probably work for us, but it seems logical that both should (with the child taking precedence)

@chad-smith
Copy link
Author

Also, sorry for keep finding problems 😄

If it's any consolation, I'm invested in flushing them all out because it's a library I intend to use in multiple projects and recommend to others 👍

@udayvunnam
Copy link
Owner

@chad-smith I really appreciate you for finding and reporting these subtle bugs - I have fixed this and also covered it in a test so that it won't break again. Fix available with version 6.2.0 🎉

https://github.com/udayvunnam/xng-breadcrumb/releases/tag/v6.2.0

@nativeforest
Copy link

nativeforest commented Oct 6, 2021

i having a issue, when a wrapp xng-breadcrumb inside another component(app-custom-breadcrumb) and and this componet is used with a ngIf sentence(to know device resolution), its seems got a empty route

@udayvunnam
Copy link
Owner

@nativeforest your issue is fixed with xng-breadcrumb@6.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants