primefaces / primefaces/primereact

TabMenu: Does not show selected tab when using templates in MenuItem

Open
#4,739 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Resolution: Workaround
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

As the Title says, when using menu items with templates, the TabMenu does not show which tab is selected.

Reproducer

https://codesandbox.io/s/primereact-demo-forked-c5sy5g

PrimeReact version

9.6.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Just click the MenuItem with template "Amy Elsner" or the one with the split button.

TabMenu does not show those tabs selected, also the layout seems to be strange.

Expected behavior

TabMenu must show selected tabs even if MenuItems use templates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodeSandbox reproducer and inspect the TabMenu and MenuItem template usage, especially the "Amy Elsner" and split-button items. Compare their behavior with a standard MenuItem, then verify that clicking templated items shows the selected tab and that the layout is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.