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: Does not show which Tab is selected when using TabPanel with template #4738

Open
VentuzVictorPerez opened this issue Aug 4, 2023 · 4 comments
Labels
Component: Theme Issue or pull request is related to Theme Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team

Comments

@VentuzVictorPerez
Copy link

Describe the bug

TabView does not show which Tab is selected when using TabPanel with template and PrimeReact is set with Arya Orange theme.

It does work with Lara Indigo theme.

Reproducer

https://codesandbox.io/s/primereact-demo-forked-7whkn5

PrimeReact version

9.6.0

React version

18.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Just click the TabPanel with template "Amy Elsner" or the one with the split button.

TabView does not show those Tabs selected.

Expected behavior

TabPanels must be displayed selected even if they use templates and the theme is Arya Orange

@VentuzVictorPerez VentuzVictorPerez added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 4, 2023
@VentuzVictorPerez VentuzVictorPerez changed the title TabView does not show which Tab is selected when using TabPanel with template and PrimeReact is set with Arya Orange theme. TabView: Does not show which Tab is selected when using TabPanel with template and PrimeReact is set with Arya Orange theme. Aug 4, 2023
@melloware
Copy link
Member

OK its not related to Theme Orange it seems to be in general because of your custom rendering of Tab HEaders.

here i made it look much better but there is some padding issues with the SplitButton: https://codesandbox.io/s/primereact-demo-forked-k66s2d?file=/src/App.js

@melloware melloware added Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 4, 2023
@melloware melloware changed the title TabView: Does not show which Tab is selected when using TabPanel with template and PrimeReact is set with Arya Orange theme. TabView: Does not show which Tab is selected when using TabPanel with template Aug 5, 2023
@VentuzVictorPerez
Copy link
Author

VentuzVictorPerez commented Aug 7, 2023

Hi @melloware

First of all, thanks for your response.

Indeed with the workaround you mention, it may work, but I still think there is something wrong with the Arya Orange theme.

The first indication is that, as I mentioned in the description, the layout works as it should when using the Lara Indigo White theme("lara-light-indigo") . If in the same page of the component you change the theme to Arya Orange you can also reproduce the error.

https://primereact.org/tabview/#template

...or use the "lara-light-indigo" theme in my forked codesandbox and you will see that it works as expected.

I wanted to go further and went into the css of each style and found differences:

Lara Indigo White:

https://github.com/primefaces/primereact/blob/master/public/themes/lara-light-indigo/theme.css#L6194

See how here the div position is absolute which makes "left" work and show the bar.

Aray Orange:

https://github.com/primefaces/primereact/blob/master/public/themes/arya-orange/theme.css#L4225

Here the div is not assigned to absolute position, so it stays in static which makes the "left" property not work.

image

Also you see that it expects the "p-tabview-nav-link" to have a parent "li", which is not the case.

@melloware
Copy link
Member

Excellent debugging let me confirm what you are seeing.

@melloware
Copy link
Member

OK I linked your issue here: primefaces/primereact-sass-theme#29

And I submitted PR here: primefaces/primereact-sass-theme#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Theme Issue or pull request is related to Theme Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants