Skip to content

Conversation

@studioromeo
Copy link

Motivation

When the bottom nav has the attribute shifting={false} the pill shape is misformed on the active tabs. On clicking around this seems inconsistent.

This appears to be because the animated view is added / removed as the tab is focused causing the animation to not play or half play. Since it starts at 0.5 scaleX this appears to the user as a squashed pill shape. The intended animation is to expand out from the center.

This commit fixes this by ensuring the animation is always present and simply varies the outputRange of the animation depending on the focused state.

Related issue

#4819

Test plan

Note: I had failures running the tests on main which i could not resolve so I've had to skip running the tests for this PR however I have run the other yarn checks. Apologies for this and I would appreciate if anyone could run the tests on this.

When the bottom nav has the attribute shifting={false} the pill shape is
misformed on the active tabs. On clicking around this seems
inconsistent. (See callstack#4819)

This appears to be because the animated view is added / removed as the
tab is focused causing the animation to not play or half play. Since it
starts at 0.5 scaleX this appears to the user as a squashed pill shape.
The intended animation is to expand out from the center.

This commit fixes this by ensuring the animation is always present and
simply varies the outputRange of the animation depending on the focused
state.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

const outlineScale = active.interpolate({
inputRange: [0, 1],
outputRange: focused ? [0.5, 1] : [0, 0],
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Tab Outline Fades Abruptly on Unfocus

The outline for a previously focused tab disappears abruptly instead of animating out smoothly. When focused becomes false, the outlineScale's outputRange immediately switches to [0, 0], causing an instant disappearance even while the active animation value is still transitioning.

Fix in Cursor Fix in Web

@callstack-bot
Copy link

Hey @studioromeo, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants