Skip to content

[Android]: box shadow are not correctly rendered inside screens #2669

@freeboub

Description

@freeboub

Description

box shadow are not correctly rendered inside screens.
overflow is never visible, it makes the shadow to be truncated.
Reproduced with fabric and only on android (works fine on ios).

Please see screenshot, the first circle is out of a screen, the second one is inside a screen
Image

Steps to reproduce

put this sample shadowed component inside a screen: (see snack sample)

  const avatarWrapper = {
    boxShadow: [
      {
        offsetX: 0,
        offsetY: 10,
        blurRadius: '20',
        spreadDistance: '0',
        color: `rgba(0, 0, 0, 0.2)`,
      },
    ],
  } as ViewStyle;

  const avatar = {
    width: WIDTH,
    height: WIDTH,
    borderRadius: WIDTH / 2,
  } as ViewStyle;

  return (<View style={{top}}>
            <View style={[avatar, avatarWrapper]}/>
          </View>);

Snack or a link to a repository

https://github.com/freeboub/bug-react-native-screens-box-shadow

Screens version

4.6.0

React Native version

0.77.0

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:androidIssue related to Android part of the libraryrepro-providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions