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

Tab panel hidden state can be broken by adjusting display #851

Closed
damyanpetev opened this issue Jul 31, 2023 · 2 comments · Fixed by #855
Closed

Tab panel hidden state can be broken by adjusting display #851

damyanpetev opened this issue Jul 31, 2023 · 2 comments · Fixed by #855
Assignees
Labels

Comments

@damyanpetev
Copy link
Member

Description

If you attempt to adjust the display property on a tab panel it'll override the built-in [hidden] styling. For example if you want to setup layout for multiple elements in the panel and go igc-tab-panel { display: flex; } that will override the hidden and all panels will be visible all the time, breaking the tabs really.

Steps to reproduce

  1. Apply display: x to any tab panel in tabs with more than one
    OR
  2. Open https://codesandbox.io/s/polished-architecture-6sznf2?file=/src/index.css
  3. Inpect the tabs

Result

Hidden doesn't do much anymore and all panels are visible:
image

Expected result

Sample is taken from https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/layouts/tabs#alignment so with this level of content I'd expect it to look just the same
image

There's already a :host(:not([hidden])) applying the default display block (which is fine) and I think this is one of those spots where a style for :host[hidden] with display none and !important would make sense.

PS: Angular's themes have this as well, likely for a similar reason https://github.com/IgniteUI/igniteui-angular/blob/72b65610d26823e8950fb8891e3503317f750387/projects/igniteui-angular/src/lib/core/styles/themes/_core.scss#L93-L95

@damyanpetev damyanpetev added bug Something isn't working 🆕 status: new The issue is new and will be reviewed when somebody picks it up. themes tab labels Jul 31, 2023
@simeonoff simeonoff assigned desig9stein and unassigned simeonoff Jul 31, 2023
@desig9stein
Copy link
Contributor

desig9stein commented Jul 31, 2023

I am not sure that we expect users to override our styles, they can have a wrapping element inside the panel and apply any display property to achieve any layout. However, if the user really wants to override the default display this can be done using this selector igc-tab-panel:not([hidden]) {display: flex;}

Example

@desig9stein desig9stein added 👀 status: in-review and removed 🆕 status: new The issue is new and will be reviewed when somebody picks it up. labels Jul 31, 2023
@simeonoff
Copy link
Collaborator

simeonoff commented Aug 1, 2023

@desig9stein The solution is to set !important to the display property in the Shadow DOM stylesheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants