Bug - [Menu] - Flyout stays open when hovering a disabled item

未關閉 適合新手
#12,637 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
react, typescript
領域
frontend

研究方向

從 MenuItem.js 開始,著重於 issue 中描述的 disabled 和 aria-disabled 處理,並檢查 disabled 項目的 CSS 行為。使用其 trigger 之後的 disabled 項目重現 flyout 互動,然後確認移動到任一 disabled 變體上時,flyout 會像對待非 flyout 項目一樣關閉。

由索引模型根據 Issue 內容生成。

描述

Describe the problem

In a Menu with containsFlyout, a flyout submenu stays open after the pointer moves from the flyout trigger onto a disabled item.

Hovering an enabled item without a flyout correctly calls setFlyoutRef(null). Disabled items never get that hover:

  1. isDisabled: .pf-v6-c-menu__list-item.pf-m-disabled has pointer-events: none, so onMouseOver does not fire.
  2. isAriaDisabled: MenuItem skips onMouseOver when isAriaDisabled is true, so setFlyoutRef(null) never runs.

How do you reproduce the problem?

  1. Open a Menu with containsFlyout.
  2. Include a flyout item, then a disabled item (isDisabled or isAriaDisabled) immediately after it.
  3. Hover the flyout item until the submenu opens.
  4. Move the pointer onto the disabled item.

Expected behavior

The flyout closes, same as hovering any other non-flyout item.

Is this issue blocking you?

No, however there is no workaround without avoiding hard-disabled items.

What is your environment?

  • OS: macOS

  • Browser: Chrome

  • Version: PatternFly React 6.6.0

What is your product and what release date are you targeting?

OpenShift Virtualization (kubevirt-plugin)

Any other information?

Seen in MenuItem.js: onMouseOver on the li is a no-op when isAriaDisabled is true. CSS: pointer-events: none on disabled list items.

https://github.com/user-attachments/assets/2b2aa70e-57ad-4ec5-97c2-2ccb8148bc8f


Jira Issue: PF-4613

主要語言
TypeScript
星號
862
分支
392
平均合併
4 天 8 小時
30 天內合併 PR
9

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

patternfly/patternfly-react 的其他 Issue

查看 patternfly/patternfly-react 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。