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

Tabview : dynamic header is not updated #9483

Closed
JordanSagnes opened this issue Nov 3, 2020 · 7 comments
Closed

Tabview : dynamic header is not updated #9483

JordanSagnes opened this issue Nov 3, 2020 · 7 comments

Comments

@JordanSagnes
Copy link

JordanSagnes commented Nov 3, 2020

[x] bug report => Search github for a similar issue or PR before submitting

Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

code : https://stackblitz.com/edit/github-7jjko1?file=src/app/app.component.html
application : https://github-7jjko1.stackblitz.io

Current behavior
For a tabview component, the header is not updated after a change (like increment a counter)

Expected behavior
After increment a counter, my tabview header is automatically updated

Minimal reproduction of the problem with instructions

  • click on the button to increment counter
  • there is no change, you need to click on the tabview to refresh its header

Please tell us about your environment:
Ubuntu or windows
On intellij or VScode
angular 10 with primeng 10.0.3
Chrome

  • Angular version:
    Angular 10

  • PrimeNG version:
    Primeng 10.0.3

  • Browser: all

  • Language: ES6/7

@Brutus5000
Copy link

Brutus5000 commented Nov 4, 2020

I ran into the same issue and since I'm using dynamic translations my TabPanels show completely empty.
Any known workarounds for this?

Also seems to be related to #9475

@JordanSagnes
Copy link
Author

I ran into the same issue and since I'm using dynamic translations my TabPanels show completely empty.
Any known workarounds for this?

Also seems to be related to #9475

Hi @Brutus5000,
For me, is not a fix but you can do this :
You can replace :

<p-tabView>
  <p-tabPanel [header]="'my.path' | translate">
     <!-- content -->
  </p-tabPanel>
</p-tabview>

by :

<p-tabView>
  <p-tabPanel>
     <ng-template pTemplate="header">
        {{ 'my.path' | translate }}
     </ng-template>
     <!-- content -->
  </p-tabPanel>
</p-tabview>

@Brutus5000
Copy link

@JordanSagnes Thank you very much. Works flawless. ❤️

@CKinAims
Copy link

Can confirm this is still an issue. Similar environment to JordanSagnes, but I just updated to v11.0.0-rc.1 and use typescript.

My issue is somewhat similar to Brutus5000 in that I am trying to translate the header. I am using a directive that calls a service to retrieve the translation from the server and then update the tabPanel.header. The header remains blank in the browser until selected then updates to show the value received from the server.

I tried the pipe + template approach JordanSagnes recommended, but with that the header remains empty.

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 25, 2020
@jacqueslareau
Copy link

Can confirm this behavior with ngx-translate. The fix using the template seems to be working.

@yigitfindikli
Copy link
Contributor

Unable to replicate with PrimeNG 11.3.1, if the issue persists please create a new ticket with a test case reproducing the issue e.g. stackblitz or a github repo and it will be reviewed by our team once again. You can check at https://stackblitz.com/edit/github-7jjko1-du5ymt

@yigitfindikli yigitfindikli removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 6, 2021
@XwolfY
Copy link

XwolfY commented Dec 1, 2021

I ran into the same issue and since I'm using dynamic translations my TabPanels show completely empty.
Any known workarounds for this?
Also seems to be related to #9475

Hi @Brutus5000, For me, is not a fix but you can do this : You can replace :

<p-tabView>
  <p-tabPanel [header]="'my.path' | translate">
     <!-- content -->
  </p-tabPanel>
</p-tabview>

by :

<p-tabView>
  <p-tabPanel>
     <ng-template pTemplate="header">
        {{ 'my.path' | translate }}
     </ng-template>
     <!-- content -->
  </p-tabPanel>
</p-tabview>

You save my day, thanks a lot !!!

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

No branches or pull requests

6 participants