Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5921 - SplitButton appendTo="self" placement is wrong #5923

Merged
merged 6 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions components/doc/panelmenu/controlleddoc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { PanelMenu } from '@/components/lib/panelmenu/PanelMenu';
import { Button } from '@/components/lib/button/Button';
import { PanelMenu } from '@/components/lib/panelmenu/PanelMenu';
import { useState } from 'react';

export function ControlledDoc(props) {
Expand Down Expand Up @@ -103,7 +103,7 @@ export function ControlledDoc(props) {
basic: `
<div className="card flex flex-column align-items-center gap-3">
<Button type="button" label="Toggle All" text onClick={() => toggleAll()} />
<PanelMenu model={items} className="w-full md:w-20rem" multiple />
<PanelMenu model={items} expandedKeys={expandedKeys} onExpandedKeysChange={setExpandedKeys} className="w-full md:w-20rem" multiple />
</div>
`,
javascript: `
Expand Down Expand Up @@ -209,7 +209,7 @@ export default function ControlledDemo() {
return (
<div className="card flex flex-column align-items-center gap-3">
<Button type="button" label="Toggle All" text onClick={() => toggleAll()} />
<PanelMenu model={items} className="w-full md:w-20rem" multiple />
<PanelMenu model={items} expandedKeys={expandedKeys} onExpandedKeysChange={setExpandedKeys} className="w-full md:w-20rem" multiple />
</div>

)
Expand Down Expand Up @@ -317,8 +317,8 @@ export default function ControlledDemo() {
return (
<div className="card flex flex-column align-items-center gap-3">
<Button type="button" label="Toggle All" text onClick={() => toggleAll()} />
<PanelMenu model={items} className="w-full md:w-20rem" multiple />
</div>
<PanelMenu model={items} expandedKeys={expandedKeys} onExpandedKeysChange={setExpandedKeys} className="w-full md:w-20rem" multiple />
</div>
)
}
`
Expand Down
2 changes: 1 addition & 1 deletion components/lib/listbox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ export const ListBox = React.memo(
DomHandler.focus(firstHiddenFocusableElement.current);
}

astHiddenFocusableElement.current.tabIndex = -1;
lastHiddenFocusableElement.current.tabIndex = -1;
};

const getOptionGroupRenderKey = (optionGroup) => {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/panelmenu/PanelMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const PanelMenu = React.memo(
setActiveItemState(_activeItemState);

if (props.multiple) {
const activeItems = activeItemsState;
let activeItems = activeItemsState;

if (
activeItemsState.some((subItem) => {
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 @@ -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
7 changes: 2 additions & 5 deletions components/lib/tieredmenu/TieredMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,9 @@ export const TieredMenu = React.memo(
};

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

if (targetWidth > DomHandler.getOuterWidth(containerRef.current)) {
containerRef.current.style.minWidth = DomHandler.getOuterWidth(targetRef.current) + 'px';
}
DomHandler.alignOverlay(containerRef.current, targetRef.current, props.appendTo, calculateMinWidth);
};

const onEnter = () => {
Expand Down
Loading