question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Border not animating with scale

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS High Sierra 10.13.2 Node: 8.5.0 Yarn: 1.1.0 npm: 5.3.0 Watchman: 4.9.0 Xcode: Xcode 9.1 Build version 9B55 Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: ^0.51.0 => 0.51.0

Target Platform: Android (26+)

Steps to Reproduce

After upgrading to react-native 0.51.0, a component that used to be animated (scales up and down based on scroll) and that has a border (with border-radius too) no longer animates. The component itself still scales (verified by adding a background) but the borders don’t. Since there has been a lot of work on borders in 0.51.0 I am assuming this has to do with that.

Steps

  1. Create a component using Animated.View that has styles including a border. In my case this is
    borderRadius: 88 / 2,
    width: 88,
    height: 88,
    borderWidth: 4,
    borderColor: 'rgba(0, 0, 0, 0.8)'

and add an animated variable as its transform: [{scale: ...}]. 2. Make sure you are using react-native 0.51.0 3. Every aspect of the component will scale as the animated value changes, except for borders

Expected Behavior

Prior to upgrading to 0.51.0 the borders used to scale

Actual Behavior

ezgif com-video-to-gif 11

Reproducible Demo

https://snack.expo.io/Sk6o8ZWMG

(Works on Appetize but not on actual phone)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:23 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
hramoscommented, Mar 16, 2018

Reopening as this was introduced in 0.48 and is still present as of 0.54

1reaction
wassghacommented, Jun 6, 2018

Seems to have been fixed (for me at least), @VinceBT maybe?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Border Layer animation not Scaling from Center - Stack Overflow
I am struggling with the strange issue like when I am adding scale transformation to any layer, it doesn't animated from the center....
Read more >
Animating Border - CSS-Tricks
You can't scale the border to specific sizes. Since the button's dimensions vary with the text, there's no way to animate the border...
Read more >
CSS border animations - web.dev
Looking at several ways to animate a border in CSS. ... The main reason to not use a proper CSS border is for...
Read more >
Animation Using CSS Transforms - The Art of Web
How to scale, rotate, translate and transform elements using new CSS hover ... border widths and font sizes and not just the box...
Read more >
Using CSS transitions - CSS: Cascading Style Sheets | MDN
CSS transitions provide a way to control animation speed when changing CSS ... The specification recommends not animating from and to auto ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found