reactjs / reactjs/react.dev

Invalid Example for Mouse and pointer events Documentation

Open
#3,661 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

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

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 Mouse and pointer events section at the linked accessibility documentation and reproduce the behavior using the provided CodePen. Read the linked MDN focus-event reference to verify the event behavior. Done means the example is corrected so the documented interaction works, or the issue is closed if the reported behavior is mistaken.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
accessibility, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.