Skip to content

Commit ebe9ee8

Browse files
committed
dont remove class, just hardcode it
1 parent 1a0ecf8 commit ebe9ee8

File tree

2 files changed

+61
-55
lines changed

2 files changed

+61
-55
lines changed

packages/react-core/src/components/Tabs/Tabs.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -598,21 +598,23 @@ class Tabs extends Component<TabsProps, TabsState> {
598598
<GenerateId>
599599
{(randomId) => (
600600
<div className={css(styles.tabsToggle)}>
601-
<Button
602-
onClick={(event) => toggleTabs(event, !isExpandedLocal)}
603-
variant="plain"
604-
aria-label={toggleAriaLabel}
605-
aria-expanded={isExpandedLocal}
606-
id={`${randomId}-button`}
607-
aria-labelledby={`${randomId}-text ${randomId}-button`}
608-
icon={
609-
<span className={css(styles.tabsToggleIcon)}>
610-
<AngleRightIcon />
611-
</span>
612-
}
613-
>
614-
{toggleText && <span id={`${randomId}-text`}>{toggleText}</span>}
615-
</Button>
601+
<div className={'pf-v6-c-tabs__toggle-button'}>
602+
<Button
603+
onClick={(event) => toggleTabs(event, !isExpandedLocal)}
604+
variant="plain"
605+
aria-label={toggleAriaLabel}
606+
aria-expanded={isExpandedLocal}
607+
id={`${randomId}-button`}
608+
aria-labelledby={`${randomId}-text ${randomId}-button`}
609+
icon={
610+
<span className={css(styles.tabsToggleIcon)}>
611+
<AngleRightIcon />
612+
</span>
613+
}
614+
>
615+
{toggleText && <span id={`${randomId}-text`}>{toggleText}</span>}
616+
</Button>
617+
</div>
616618
</div>
617619
)}
618620
</GenerateId>

packages/react-core/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -491,58 +491,62 @@ exports[`should render expandable vertical tabs 1`] = `
491491
<div
492492
class="pf-v6-c-tabs__toggle"
493493
>
494-
<button
495-
aria-labelledby="generated-id-text generated-id-button"
496-
class="pf-v6-c-button pf-m-plain"
497-
data-ouia-component-id="OUIA-Generated-Button-plain-:r14:"
498-
data-ouia-component-type="PF6/Button"
499-
data-ouia-safe="true"
500-
id="generated-id-button"
501-
type="button"
494+
<div
495+
class="pf-v6-c-tabs__toggle-button"
502496
>
503-
<span
504-
class="pf-v6-c-button__icon pf-m-start"
497+
<button
498+
aria-labelledby="generated-id-text generated-id-button"
499+
class="pf-v6-c-button pf-m-plain"
500+
data-ouia-component-id="OUIA-Generated-Button-plain-:r14:"
501+
data-ouia-component-type="PF6/Button"
502+
data-ouia-safe="true"
503+
id="generated-id-button"
504+
type="button"
505505
>
506506
<span
507-
class="pf-v6-c-tabs__toggle-icon"
507+
class="pf-v6-c-button__icon pf-m-start"
508508
>
509-
<svg
510-
aria-hidden="true"
511-
class="pf-v6-svg"
512-
fill="currentColor"
513-
height="1em"
514-
role="img"
515-
width="1em"
509+
<span
510+
class="pf-v6-c-tabs__toggle-icon"
516511
>
517512
<svg
518-
class="pf-v6-icon-default"
519-
viewBox="0 0 256 512"
520-
>
521-
<path
522-
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
523-
/>
524-
</svg>
525-
<svg
526-
class="pf-v6-icon-rh-ui"
527-
viewBox="0 0 32 32"
513+
aria-hidden="true"
514+
class="pf-v6-svg"
515+
fill="currentColor"
516+
height="1em"
517+
role="img"
518+
width="1em"
528519
>
529-
<path
530-
d="M11 30a.999.999 0 0 1-.707-1.707L22.586 16 10.293 3.707a.999.999 0 1 1 1.414-1.414l12.646 12.646a1.501 1.501 0 0 1 0 2.121L11.707 29.706a.997.997 0 0 1-.707.293Z"
531-
/>
520+
<svg
521+
class="pf-v6-icon-default"
522+
viewBox="0 0 256 512"
523+
>
524+
<path
525+
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
526+
/>
527+
</svg>
528+
<svg
529+
class="pf-v6-icon-rh-ui"
530+
viewBox="0 0 32 32"
531+
>
532+
<path
533+
d="M11 30a.999.999 0 0 1-.707-1.707L22.586 16 10.293 3.707a.999.999 0 1 1 1.414-1.414l12.646 12.646a1.501 1.501 0 0 1 0 2.121L11.707 29.706a.997.997 0 0 1-.707.293Z"
534+
/>
535+
</svg>
532536
</svg>
533-
</svg>
537+
</span>
534538
</span>
535-
</span>
536-
<span
537-
class="pf-v6-c-button__text"
538-
>
539539
<span
540-
id="generated-id-text"
540+
class="pf-v6-c-button__text"
541541
>
542-
toggle
542+
<span
543+
id="generated-id-text"
544+
>
545+
toggle
546+
</span>
543547
</span>
544-
</span>
545-
</button>
548+
</button>
549+
</div>
546550
</div>
547551
<ul
548552
class="pf-v6-c-tabs__list"

0 commit comments

Comments
 (0)