Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border not animating with scale #17224

Closed
wassgha opened this issue Dec 15, 2017 · 23 comments
Closed

Border not animating with scale #17224

wassgha opened this issue Dec 15, 2017 · 23 comments
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@wassgha
Copy link

wassgha commented Dec 15, 2017

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)

@wassgha

This comment has been minimized.

@beeirl

This comment has been minimized.

@zachgibson
Copy link

@wassgha I ran the snack and it was a different app example. Where is the snack for the GIF you posted?

@wassgha
Copy link
Author

wassgha commented Dec 30, 2017

@zachgibson the snack is an isolated version of the bug that occurs inside the beta of our app (which you can see in the gif). I can invite you to the beta if you'd like but the effect is the same. The difference is that the animated value in our app is controlled by scroll rather than time.

@arma7x
Copy link

arma7x commented Jan 6, 2018

Same for me. Temporary downgrade to rn 0.49 works perfectly

@uribro
Copy link

uribro commented Jan 8, 2018

this was broken in 0.51.0 downgrade to 0.50.0 works.

uribro referenced this issue Jan 9, 2018
Reviewed By: achen1

Differential Revision: D5982241

fbshipit-source-id: 2f694daca7e1b16b5ff65f07c7d15dd558a4b7e8
@nadavoran
Copy link

nadavoran commented Jan 29, 2018

Still broken in 0.52.2!

@aahz
Copy link

aahz commented Feb 7, 2018

Still broken for 0.53.0

Now using hack with react-native-svg.Circle to get around the problem, may be this will help someone

Suppose ART library will help too

@react-native-bot

This comment has been minimized.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@hssrrw
Copy link

hssrrw commented Feb 27, 2018

The bug is still reproduced in 0.53.0. Does anyone have an idea how this could be possibly fixed?

@MLWDev
Copy link

MLWDev commented Mar 4, 2018

This is still an issue, just upgraded from 0.50 where it was working. Can this be reopened?

@hramos
Copy link
Contributor

hramos commented Mar 16, 2018

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

@VinceBT

This comment has been minimized.

@RSNara
Copy link
Contributor

RSNara commented Jun 6, 2018

Hey @wassgha!

I tried to reproduce this issue on v0.50.0, v0.51.0, and v0.55.0 of React Native, but wasn't able to. I v0.51.0 and v0.55.0 to reproduce the problem, and v0.50.0 to work fine. To attempt reproduction, I built React Native directly from the Github repository and plugged your code into RNTester.

When the above setup didn't work, I used expo to run your snack on my S8, but still had no luck.

I also created a new project using create-react-native-app, and changed the react-native version to 0.51 by making the following changes to package.json:

  "dependencies": {
    "expo": "^24.0.0",
    "react": "16.3.1",
    "react-native": "~0.51.0"
  }

Changes made to app.json:

{
  "expo": {
    "sdkVersion": "24.0.0"
  }
}

With a brand new project running react native v0.51.0, I couldn't reproduce the problem.

Observed Behaviour: What I see is a pulsating black circle surrounded by a red border, which I expect is the correct behaviour.

It could be that I'm making a mistake somewhere. Does this problem still reproduce for you?

@wassgha
Copy link
Author

wassgha commented Jun 6, 2018

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

@VinceBT
Copy link

VinceBT commented Jun 7, 2018

@wassgha Which version are you using ?

@RSNara
Copy link
Contributor

RSNara commented Jun 10, 2018

@hramos, is this issue still a problem?

@nadavoran
Copy link

I didn't upgrade to 0.55 but I could still see the issue on 0.53.
When I run my app on large Android phones (like the pixel) everything seems to be ok, but when I run it on a smaller device like Samsung s7 the issue reproduces

@hramos
Copy link
Contributor

hramos commented Jun 13, 2018

If you're not using 0.56, no need to comment saying it still happens on an older release. Can someone verify if this still occurs on 0.56.0-rc? The RC should have the fixes from master that @RSNara already verified as working.

@Fsarmento
Copy link

I am still having this exact same issue on 0.56. it only happens when borderRadius is set to a value bigger than 0.

react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0

I made a simple example on expo snack here. Scan the QR code with an Android 7.0 phone to reproduce the bug.

@nicollecastrog
Copy link

nicollecastrog commented Sep 14, 2018

@hramos I'm having this same issue on 0.56. It's worth noting that other issues around static elements with borders using borderRadius being blurred in Android were in fact fixed here, so the upgrade to RN 0.56 fixes that. My static round buttons, for example, look crisp now.

The issue that remains is when you try to animate an element that uses borderRadius (whether it's got borders or not): the edges are pixelated. In my case I'm trying to animate a circle with some background colour from small to large, in a "screen takeover":

Device info:
Google Pixel, API 27, Android 8.1

@hramos hramos changed the title Border not animating with scale in 0.51.0 Border not animating with scale Sep 26, 2018
@stale
Copy link

stale bot commented Dec 25, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2018
@stale
Copy link

stale bot commented Jan 2, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 2, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jan 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests