Skip to content

Pointer event is not applied for grand-children #2606

Description

@tienifr

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

There's a box-none value in RN web but currently it's implemented incorrectly. Currently the child elements of it 's implemented like parent > *: { pointer-events: auto } (see here) which only affects direct children. So the grand-children will still inherit the pointer-events: none

Expected behavior

All components inside parent that has pointer-events: box-none should be pointer-events: auto

Steps to reproduce

  1. Create the container View that has pointer-events: none
  2. Inside that View, create the child View that has pointer-events: box-none
  3. Inside child View, create the View within onClick function
  4. Observe that onClick function is not trigger

Test case

https://codesandbox.io/s/crazy-chihiro-yz9y4k

Additional comments

No response

Proposed solution

Update to the pattern parent *: { pointer-events: auto } so it affects all children. That means updating the >* to * in this line

This is recommended in the RN doc as well https://reactnative.dev/docs/view#pointerevents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions