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

TabMenu: Inkbar Not Aligned With Active Route #14218

Closed
shawnweeks opened this issue Nov 27, 2023 · 4 comments
Closed

TabMenu: Inkbar Not Aligned With Active Route #14218

shawnweeks opened this issue Nov 27, 2023 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@shawnweeks
Copy link

Describe the bug

For all the material design and material design compact themes the inkbar is not located under the active TabMenu tab when accessing the page directly via routing. For other themes like lara-light-blue that use pure CSS the issue isn't there. These seems to be caused by tabChanged being undefined at

if (this.tabChanged) {
when accessing a tab directly via the route instead of clicking.

Overriding the function definition like this seems to resolve the issue.

TabMenu.prototype.ngAfterViewChecked = function () {
      if (this.tabChanged ? this.tabChanged : true) {
        this.updateInkBar();
        this.tabChanged = false;
      }
    }
Screenshot 2023-11-27 at 3 25 36 PM

Environment

Angular CLI: 17.0.3
Node: 20.10.0
Package Manager: npm 10.2.3
OS: darwin arm64

Reproducer

https://stackblitz.com/~/github.com/shawnweeks/primeng-tab-menu-bug

Angular version

17.0.4

PrimeNG version

17.0.0-beta.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

17.0.0-beta.1

Browser(s)

Firefox 119.0.1

Steps to reproduce the behavior

  1. Open project using StackBlitz Link
  2. Wait for project to start
  3. Add /first or /second to the end of the mini browser url
  4. Notice how the text is highlighted correctly but the inkbar is all the way to the left.

Expected behavior

No response

@shawnweeks shawnweeks added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 27, 2023
@nclsstdl
Copy link

ran into the same issue today with version 17.6.0

@balkaninal
Copy link

I encountered the same issue today. The routerLink values in the tabMenu didn't work correctly with router-outlet. The active item wasn't set on the first click but updated on the next click. I used the "overriding the function" above to fix it, thank you.

version 15.4.1

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

@shawnweeks
Copy link
Author

I've confirmed that this issue no longer occurs in 17.18.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

4 participants