Skip to content

Commit

Permalink
Revert "fix: className doesn't work with tabPanel (#420)" (#449)
Browse files Browse the repository at this point in the history
This reverts commit a412700.
  • Loading branch information
afc163 authored Nov 26, 2021
1 parent a3e9630 commit 30be80a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/examples/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default () => {
<TabPane key="light" tab="light">
Light
</TabPane>,
<TabPane className='panda' key="bamboo" tab="bamboo">
<TabPane key="bamboo" tab="bamboo">
Bamboo
</TabPane>,
<TabPane key="cute" tab="cute" disabled>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"docs:deploy": "gh-pages -d .doc",
"compile": "father build && npm run compile:style",
"test": "father test",
"test:update": "father test --u",
"coverage": "father test --coverage",
"now-build": "npm run build",
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
Expand Down Expand Up @@ -68,7 +67,7 @@
"react-dnd": "^10.0.0",
"react-dnd-html5-backend": "^10.0.0",
"react-dom": "^16.0.0",
"react-router": "^5.0.0",
"react-router": "^3.0.0",
"react-sticky": "^6.0.3",
"react-test-renderer": "^16.0.0",
"sortablejs": "^1.7.0",
Expand Down
4 changes: 1 addition & 3 deletions src/TabNavList/TabNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface TabNodeProps {
onRemove: () => void;
onFocus: React.FocusEventHandler;
style?: React.CSSProperties;
className?: string;
}

function TabNode(
Expand All @@ -35,7 +34,6 @@ function TabNode(
onRemove,
onFocus,
style,
className,
}: TabNodeProps,
ref: React.Ref<HTMLDivElement>,
) {
Expand Down Expand Up @@ -65,7 +63,7 @@ function TabNode(
<div
key={key}
ref={ref}
className={classNames(tabPrefix, className, {
className={classNames(tabPrefix, {
[`${tabPrefix}-with-remove`]: removable,
[`${tabPrefix}-active`]: active,
[`${tabPrefix}-disabled`]: disabled,
Expand Down
3 changes: 1 addition & 2 deletions src/TabNavList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
}

const tabNodes: React.ReactElement[] = tabs.map((tab, i) => {
const { key, className: tabClassName } = tab;
const { key } = tab;
return (
<TabNode
id={id}
Expand All @@ -292,7 +292,6 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
tab={tab}
/* first node should not have margin left */
style={i === 0 ? undefined : tabNodeStyle}
className={tabClassName}
closable={tab.closable}
editable={editable}
active={key === activeKey}
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`Tabs.Basic Normal 1`] = `
</div>
</div>
<div
class="rc-tabs-tab panda rc-tabs-tab-active"
class="rc-tabs-tab rc-tabs-tab-active"
>
<div
aria-controls="rc-tabs-test-panel-bamboo"
Expand Down Expand Up @@ -98,7 +98,7 @@ exports[`Tabs.Basic Normal 1`] = `
<div
aria-hidden="false"
aria-labelledby="rc-tabs-test-tab-bamboo"
class="rc-tabs-tabpane rc-tabs-tabpane-active panda"
class="rc-tabs-tabpane rc-tabs-tabpane-active"
id="rc-tabs-test-panel-bamboo"
role="tabpanel"
tabindex="0"
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Tabs.Basic', () => {
<TabPane tab="light" key="light">
Light
</TabPane>,
<TabPane tab="bamboo" className="panda" key="bamboo">
<TabPane tab="bamboo" key="bamboo">
Bamboo
</TabPane>,
<TabPane tab="cute" key="cute">
Expand Down

1 comment on commit 30be80a

@vercel
Copy link

@vercel vercel bot commented on 30be80a Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.