Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pointerEvents doc #6534

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 18 additions & 15 deletions Libraries/Components/View/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,35 +227,38 @@ const View = React.createClass({
onLayout: PropTypes.func,

/**
* In the absence of `auto` property, `none` is much like `CSS`'s `none`
* value. `box-none` is as if you had applied the `CSS` class:
* Controls whether the View can be the target of touch events.
*
* - 'auto': The View can be the target of touch events.
* - 'none': The View is never the target of touch events.
* - 'box-none': The View is never the target of touch events but it's
* subviews can be. It behaves like if the following classes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: like in the following cases / like the following cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, typo :) there's another one a few lines below since I copy pasted that part.

Will it work if I fix it now since you already shiped it?

* in CSS:
* ```
* .box-none {
* pointer-events: none;
* pointer-events: none;
* }
* .box-none * {
* pointer-events: all;
* pointer-events: all;
* }
* ```
*
* `box-only` is the equivalent of
*
* - 'box-only': The view can be the target of touch events but it's
* subviews cannot be. It behaves like if the following classes
* in CSS:
* ```
* .box-only {
* pointer-events: all;
* pointer-events: all;
* }
* .box-only * {
* pointer-events: none;
* pointer-events: none;
* }
* ```
*
* But since `pointerEvents` does not affect layout/appearance, and we are
* already deviating from the spec by adding additional modes, we opt to not
* include `pointerEvents` on `style`. On some platforms, we would need to
* implement it as a `className` anyways. Using `style` or not is an
* implementation detail of the platform.
*/
// Since `pointerEvents` does not affect layout/appearance, and we are
// already deviating from the spec by adding additional modes, we opt to not
// include `pointerEvents` on `style`. On some platforms, we would need to
// implement it as a `className` anyways. Using `style` or not is an
// implementation detail of the platform.
pointerEvents: PropTypes.oneOf([
'box-none',
'none',
Expand Down