software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

[2.19.0] Pressable now interferes with parent's dimensions #3085

Closed TomCorvus closed 2 months ago

TomCorvus commented 2 months ago

Description

Since 2.19.0, when we use Pressable component from RNGH, parent is now stretched over all available space.

Steps to reproduce

  1. Install RNGH 2.19.0
  2. Use this code :
    <>
    <View style={{ backgroundColor: 'red' }}>
        <Pressable>
            <Text>Button</Text>
        </Pressable>
    </View>
    <View style={{ flex: 1, backgroundColor: 'blue' }}>
        <Text>Screen body</Text>
    </View>
    </>

The first view will take all the screen when it should only take up the space that the button takes.

Snack or a link to a repository

https://snack.expo.dev/@tom.corvus/rngh_pressable_2190

Gesture Handler version

2.19.0

React Native version

0.75.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

None

Device

iOS simulator

Device model

All devices (Emulators/Real)

Acknowledgements

Yes

latekvo commented 2 months ago

Hi @TomCorvus, thank you for the report.

I've opened this PR to hopefully resolve this issue, please let me know if it fixes your issue.

TomCorvus commented 2 months ago

Thanks @latekvo it seems to fix the problem. 💪