Skip to content

Commit

Permalink
Fix primefaces#5921 - SplitButton appendTo="self" placement is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
gucal committed Feb 8, 2024
1 parent 1def48d commit 3eb9358
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/lib/splitbutton/SplitButtonBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const SplitButtonBase = ComponentBase.extend({
id: null,
label: null,
icon: null,
autoZIndex: false,
autoZIndex: true,
baseZIndex: 0,
loading: false,
loadingIcon: null,
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 @@ -563,10 +563,12 @@ export const TieredMenu = React.memo(
};

const alignOverlay = () => {
DomHandler.absolutePosition(containerRef.current, targetRef.current);
const targetWidth = DomHandler.getOuterWidth(targetRef.current);
const calculateMinWidth = targetWidth > DomHandler.getOuterWidth(containerRef.current);

if (targetWidth > DomHandler.getOuterWidth(containerRef.current)) {
DomHandler.alignOverlay(containerRef.current, targetRef.current, props.appendTo, calculateMinWidth);

if (calculateMinWidth) {
containerRef.current.style.minWidth = DomHandler.getOuterWidth(targetRef.current) + 'px';
}
};
Expand Down

0 comments on commit 3eb9358

Please sign in to comment.