Suggestion for "Hit Testing | renderobjects.com"

Open Beginner friendly
#2 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
dart, flutter
Domain
documentation

Research direction

Find the source for the “Hit Testing” page at renderobjects.com, using the “The hitTest Method” heading and linked section as entry points. Add a concise explanation of RenderBox.hitTest’s return behavior based on the issue text, then verify the rendered page communicates that hit testing may be concluded by the render object or a child.

Written by the indexing model from the issue text.

Description

Page: https://renderobjects.com/guides/hit-testing/#the-hittest-method

Selected text is bolded below, with the surrounding paragraph(s) for context:

The hitTest Method#

Potential suggestion: A common mistake beginners make is to assume that RenderBox.hitTest returns true if the position is in the current render object. However, that is incorrect. Instead, RenderBox.hitTest returns whether hit testing was concluded by this render object or one of its children. In other words, a render object that is hit should return false if it wants hit testing to continue.

I'd consider adding a quick explanation on this behavior since this is common misunderstanding. In hindsight, perhaps we should've made hitTest return an enum to make this behavior much more obvious (eg HitTestStatus.absorbed, HitTestStatus.continue)

Dominant language
Dart
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.