Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gucal authored Feb 13, 2024
2 parents 5c465e0 + 13e0879 commit cecfa3b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ body:
id: reproducer
attributes:
label: Reproducer
placeholder: https://codesandbox.io/s/primereact-test-forked-bbns8k
placeholder: https://stackblitz.com/edit/vitejs-vite-daiajq
description: |
Please fork the [CodeSandbox project](https://codesandbox.io/s/primereact-test-forked-bbns8k) or [Stackblitz project](https://stackblitz.com/edit/vitejs-vite-daiajq?file=src%2FApp.tsx) and create a case demonstrating your bug report. Issues **without** a CodeSandbox have much less possibility to be reviewed.
Please fork [Stackblitz project](https://stackblitz.com/edit/vitejs-vite-daiajq?file=src%2FApp.tsx) and create a case demonstrating your bug report. Issues **without** a CodeSandbox have much less possibility to be reviewed.
validations:
required: false
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Please fork the [CodeSandbox project](https://codesandbox.io/s/primereact-test-forked-bbns8k) or [Stackblitz project](https://stackblitz.com/edit/vitejs-vite-daiajq?file=src%2FApp.tsx) and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.
Please fork the [Stackblitz project](https://stackblitz.com/edit/vitejs-vite-daiajq?file=src%2FApp.tsx) and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.
4 changes: 2 additions & 2 deletions components/lib/menubar/Menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export const Menubar = React.memo(

const onEnterKey = (event) => {
if (focusedItemInfo.index !== -1) {
const element = DomHandler.findSingle(rootMenuRef.current, `li[id="${`${focusedItemId}`}"]`);
const element = DomHandler.findSingle(rootMenuRef.current, `li[data-id="${`${focusedItemId}`}"]`);
const anchorElement = element && DomHandler.findSingle(element, 'a[data-pc-section="action"]');

anchorElement ? anchorElement.click() : element && element.click();
Expand Down Expand Up @@ -483,7 +483,7 @@ export const Menubar = React.memo(

const scrollInView = (index = -1) => {
const id = index !== -1 ? `${idState}_${index}` : focusedItemId;
const element = DomHandler.findSingle(rootMenuRef.current, `li[id="${id}"]`);
const element = DomHandler.findSingle(rootMenuRef.current, `li[data-id="${id}"]`);

if (element) {
element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' });
Expand Down
20 changes: 11 additions & 9 deletions components/lib/menubar/MenubarSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export const MenubarSub = React.memo(
};

const getItemId = (processedItem) => {
if (processedItem.item && processedItem.item.id) {
return processedItem.item.id;
}
return processedItem.item?.id;
};

const getItemDataId = (processedItem) => {
return `${props.id}_${processedItem.key}`;
};

Expand All @@ -87,7 +87,7 @@ export const MenubarSub = React.memo(
};

const isItemFocused = (processedItem) => {
return props.focusedItemId === getItemId(processedItem);
return props.focusedItemId === getItemDataId(processedItem);
};

const isItemGroup = (processedItem) => {
Expand All @@ -106,8 +106,8 @@ export const MenubarSub = React.memo(
const key = props.id + '_separator_' + index;
const separatorProps = mergeProps(
{
id: key,
key,
'data-id': key,
className: cx('separator'),
role: 'separator'
},
Expand Down Expand Up @@ -150,7 +150,8 @@ export const MenubarSub = React.memo(
return null;
}

const key = getItemId(processedItem);
const id = getItemId(processedItem);
const dataId = getItemDataId(processedItem);
const active = isItemActive(processedItem);
const focused = isItemFocused(processedItem);
const disabled = isItemDisabled(processedItem) || false;
Expand Down Expand Up @@ -236,8 +237,9 @@ export const MenubarSub = React.memo(

const menuitemProps = mergeProps(
{
id: key,
key,
id,
key: id,
'data-id': dataId,
role: 'menuitem',
'aria-label': item.label,
'aria-disabled': disabled,
Expand Down Expand Up @@ -283,7 +285,7 @@ export const MenubarSub = React.memo(
onFocus: props.onFocus,
onBlur: props.onBlur,
onKeyDown: props.onKeyDown,
id: props.id,
'data-id': props.id,
tabIndex: tabIndex,
'aria-activedescendant': props.ariaActivedescendant,
style: props.style,
Expand Down

0 comments on commit cecfa3b

Please sign in to comment.