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

feat(design)!: update breadcrumb active state implementation #3523

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

xelaint
Copy link
Member

@xelaint xelaint commented Feb 24, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Enduser is allowed to use the active property, but it should just default to the last breadcrumb item.

Fixes: #3514

What is the new behavior?

The active state is automatically set to the last breadcrumb item in a list of breadcrumbs.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

BREAKING CHANGE: T active property is no longer available to use. The last breadcrumb item will automatically be set to the active state.

Other information

@xelaint xelaint added package: design @daffodil/design 🚨 breaking changes This PR or issue will cause a breaking change labels Feb 24, 2025
@xelaint xelaint requested review from a team as code owners February 24, 2025 14:59
@xelaint xelaint requested a review from damienwebdev February 24, 2025 14:59
@xelaint xelaint requested a review from damienwebdev February 26, 2025 14:26
setActive(value: boolean) {
this._active = value;
if (value) {
this.renderer.addClass(this.elementRef.nativeElement, 'active');
Copy link
Member

@damienwebdev damienwebdev Feb 26, 2025

Choose a reason for hiding this comment

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

I think it makes more sense to keep the original implementation and just remove the original @Input. I think access to the renderer should be used sparingly.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@damienwebdev
Copy link
Member

@xelaint can you add an example with an @for? I've seen afterContentInit operations like this new code performs have errors when the child content is inside an @for.

@xelaint
Copy link
Member Author

xelaint commented Mar 3, 2025

@damienwebdev Added the example. The implementation in next.daff.io/docs also uses @for and it seems to be fine w/ no errors.

@xelaint xelaint requested a review from damienwebdev March 10, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 breaking changes This PR or issue will cause a breaking change package: design @daffodil/design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Set the last breadcrumb item to be active by default
2 participants