Skip to content

Commit 3e22873

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Update View-itest.js for pointerEvents box-only unflattening behavior (#55224)
Summary: Pull Request resolved: #55224 Changelog: [Internal] D90772188 changed the behavior of views with `pointerEvents="box-only"` to prevent them from being collapsed/flattened. This is intentional because when `important_for_interaction` is applied on a view with `pointerEvents='box-only'`, the view must remain in the hierarchy to correctly signal to the gaze system that its children are not important for interaction. The test expected the old behavior where `<View pointerEvents="box-only" />` would be collapsed and render `null`. After the C++ change, views with `pointerEvents="box-only"` now always form a stacking context and are not collapsed. Updated the test to expect the new behavior where `pointerEvents="box-only"` causes views to unflatten, consistent with how `pointerEvents="none"` behaves. Reviewed By: rubennorte Differential Revision: D90984297 fbshipit-source-id: 799e4e26b29126386f4fd8183e2ce0b5cb719f9f
1 parent 9f686f2 commit 3e22873

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

  • packages/react-native/Libraries/Components/View/__tests__

packages/react-native/Libraries/Components/View/__tests__/View-itest.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,24 +313,16 @@ describe('<View>', () => {
313313
root.getRenderedOutput({props: ['pointerEvents']}).toJSX(),
314314
).toEqual(null);
315315
});
316-
it('box-only propagates to the mounting layer, does not unflatten', () => {
316+
it('box-only propagates to the mounting layer, unflattens', () => {
317317
const root = Fantom.createRoot();
318318

319-
Fantom.runTask(() => {
320-
root.render(<View collapsable={false} pointerEvents="box-only" />);
321-
});
322-
323-
expect(
324-
root.getRenderedOutput({props: ['pointerEvents']}).toJSX(),
325-
).toEqual(<rn-view pointerEvents="box-only" />);
326-
327319
Fantom.runTask(() => {
328320
root.render(<View pointerEvents="box-only" />);
329321
});
330322

331323
expect(
332324
root.getRenderedOutput({props: ['pointerEvents']}).toJSX(),
333-
).toEqual(null);
325+
).toEqual(<rn-view pointerEvents="box-only" />);
334326
});
335327
it('none propagates to the mounting layer, unflattens', () => {
336328
const root = Fantom.createRoot();

0 commit comments

Comments
 (0)