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 摘要。