Skip to content

Commit ff21af1

Browse files
more button plugin should override tablisView component
1 parent 07ca345 commit ff21af1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/plugins/moreButtonPlugin/index.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,30 @@ function ShowMoreButton(deps, props) {
1212
ShowMoreButton.propTypes /* remove-proptypes */ = {
1313
children: PropTypes.element,
1414
};
15-
export default function ResponsiveFactory(ctx, components) {
16-
const {setting} = ctx.optionsManager;
17-
setting.responsiveClass = 'rc-dyn-tabs-responsive';
18-
const MoreButtonPlugin = ShowMoreButton.bind(undefined, {ctx, components});
15+
function setTablistOverflow(ctx, components) {
16+
components.MoreButtonPlugin = ShowMoreButton.bind(undefined, {ctx, components});
1917
if (!components.OriginalTablistOverflow) {
2018
components.OriginalTablistOverflow = components.TablistOverflow;
2119
components.TablistOverflow = function (props) {
2220
return (
2321
<components.OriginalTablistOverflow {...props}>
2422
{props.children}
25-
<MoreButtonPlugin />
23+
<components.MoreButtonPlugin />
2624
</components.OriginalTablistOverflow>
2725
);
2826
};
2927
}
3028
}
29+
function setTablistView(ctx, components) {
30+
components.TablistView = components.TablistViewFactory.bind(undefined, (ins) => ({
31+
tablistViewPropsManager: () => {
32+
let {className} = components.tablistViewPropsManager(ins);
33+
className += ' rc-dyn-tabs-responsive';
34+
return {className};
35+
},
36+
}));
37+
}
38+
export default function ResponsiveFactory(ctx, components) {
39+
setTablistView(ctx, components);
40+
setTablistOverflow(ctx, components);
41+
}

0 commit comments

Comments
 (0)