reactjs / reactjs/react.dev

Invalid Example for Mouse and pointer events Documentation

未關閉
#3,661 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

Hi, I think here is Invalid example for this documentation

https://reactjs.org/docs/accessibility.html#mouse-and-pointer-events

In this documentation, there is a code not to close the pop-over when focusing on the child.

// If a child receives focus, do not close the popover.
onFocusHandler() {
  clearTimeout(this.timeOutId);
}

but, when i click child element, child element doesn't receive focus
so when i click child element, the pop-over closes.

CodePen

I think it's because of onFocus event does not bubble.

https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event

This example is likely to cause confusion. How about modify the example to make it work?

If I'm mistaken, I think This issue may well be closed.

thanks

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從連結的無障礙文件中的 Mouse and pointer events 部分開始,並使用提供的 CodePen 重現該行為。閱讀連結的 MDN focus-event 參考文件,以驗證事件行為。範例已修正且文件所述的互動能正常運作,或者如果回報的行為有誤則關閉 issue,即表示完成。

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

評估

技術堆疊
javascript, react
領域
accessibility, documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

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

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