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

More menu focus lose with keyboard when used in Treetable #6461

Open
muhtomakin opened this issue Apr 24, 2024 · 0 comments
Open

More menu focus lose with keyboard when used in Treetable #6461

muhtomakin opened this issue Apr 24, 2024 · 0 comments
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA

Comments

@muhtomakin
Copy link

Describe the bug

import React, { useState, useEffect, useRef } from 'react';
import { TreeTable } from 'primereact/treetable';
import { Column } from 'primereact/column';
import { Menu } from 'primereact/menu';
import { Button } from 'primereact/button';
import { NodeService } from './service/NodeService';

export default function BasicDemo() {
  const [nodes, setNodes] = useState([]);
  const menu = useRef(null);

  useEffect(() => {
    NodeService.getTreeTableNodes().then((data) => setNodes(data));
  }, []);

  const items = [
    {
      label: 'Edit',
    },
    {
      label: 'Delete',
    },
  ];

  const actionTemplate = () => {
    return (
      <>
        <Menu model={items} ref={menu} popup />
        <Button
          icon="pi pi-ellipsis-h"
          onClick={(event) => menu?.current?.toggle(event)}
        />
      </>
    );
  };

  return (
    <div className="card">
      <TreeTable value={nodes} tableStyle={{ minWidth: '50rem' }}>
        <Column field="name" header="Name" expander></Column>
        <Column field="size" header="Size"></Column>
        <Column field="type" body={actionTemplate}></Column>
      </TreeTable>
    </div>
  );
}

This is the example code of bug. After opening the more menu, just try to reach the menu items with keyboard and it is jumping.

Reproducer

No response

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

ALL

Steps to reproduce the behavior

Just copy the code for any Treetable example.

Expected behavior

No response

@muhtomakin muhtomakin added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 24, 2024
@melloware melloware added Component: Accessibility Issue or pull request is related to WCAG or ARIA and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA
Projects
None yet
Development

No branches or pull requests

2 participants