Skip to content

Text shadow doesn't render when blur is set but offset is (0,0) #17277

Closed
@Firehed

Description

@Firehed

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.1
Node: 8.9.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.0.1 Build version 9A1004
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: ^0.49.3 => 0.49.5

Steps to Reproduce

<Text style={{
    textShadowOffset: { height: 0, width: 0 },
    textShadowColor: 'red',
    textShadowRadius: 3,
}}>This text should have a shadow</Text>

Expected Behavior

Text should have a blurred shadow with no offset, similar to having text-shadow: 0 0 3px red in CSS.

Actual Behavior

No shadow exists at all

Reproducible Demo

https://snack.expo.io/B1X1Lzvff

Other

At least on iOS, I think the issue is an overly-grabby conditional in Libraries/Text/RCTShadowText.m, something like if (!CGSizeEqualToSize(_textShadowOffset, CGSizeZero) || _textShadowRadius != 0.0) {. Not too sure about the build process so I can't easily test that fix locally. Plus it seems to occur on Android as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions