Skip to content

Commit

Permalink
Fix #7259: SplitButton menu passthrough (#7264)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 27, 2024
1 parent a280a57 commit 54df137
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion components/lib/splitbutton/SplitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@ export const SplitButton = React.memo(
style={props.menuStyle}
autoZIndex={props.autoZIndex}
baseZIndex={props.baseZIndex}
className={props.menuClassName}
className={classNames(props.menuClassName, cx('menu'))}
onClick={onPanelClick}
onShow={onMenuShow}
onHide={onMenuHide}
pt={ptm('menu')}
__parentMetadata={{
parent: metaData
}}
/>
</div>
{hasTooltip && <Tooltip target={elementRef} content={props.tooltip} pt={ptm('tooltip')} {...props.tooltipOptions} />}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/splitbutton/SplitButtonBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const classes = {
}),
button: 'p-splitbutton-defaultbutton',
menuButton: 'p-splitbutton-menubutton',
menu: ({ subProps: props }) => classNames('p-menu p-menu-overlay p-component', props.menuClassName),
menu: ({ props }) => classNames('p-menu p-menu-overlay p-component', props.menuClassName),
menuList: 'p-menu-list p-reset',
separator: 'p-menu-separator',
menuIcon: 'p-menuitem-icon',
Expand Down
6 changes: 4 additions & 2 deletions components/lib/tieredmenu/TieredMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ export const TieredMenu = React.memo(
const [visibleItems, setVisibleItems] = React.useState([]);
const [focusTrigger, setFocusTrigger] = React.useState(false);
const [attributeSelectorState, setAttributeSelectorState] = React.useState(null);
const { ptm, cx, sx, isUnstyled } = TieredMenuBase.setMetaData({
const metaData = {
props,
...props.__parentMetadata,
state: {
id: idState,
visible: visibleState,
attributeSelector: attributeSelectorState
}
});
};
const { ptm, cx, sx, isUnstyled } = TieredMenuBase.setMetaData(metaData);

useHandleStyle(TieredMenuBase.css.styles, isUnstyled, { name: 'tieredmenu' });

Expand Down
1 change: 1 addition & 0 deletions components/lib/tieredmenu/TieredMenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const styles = `
export const TieredMenuBase = ComponentBase.extend({
defaultProps: {
__TYPE: 'TieredMenu',
__parentMetadata: null,
id: null,
model: null,
popup: false,
Expand Down

0 comments on commit 54df137

Please sign in to comment.