wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.01k stars 2.68k forks source link

RightButtons jumps on Android #7832

Closed idutka closed 3 months ago

idutka commented 5 months ago

What happened?

When the icon is used for rightButtons inside topBar, it jumps when the new screen is pushed/popped in the stack.

Jan-22-2024 16-18-56

Note: If a custom component is used for the button, the button doesn't jump.

What was the expected behaviour?

The RightButton with the icon should not jump during navigation.

Is there any solution for this other than using a custom button? A custom button adds unnecessary complexity.

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

It can be reproduced with Playground app. Just add the icon and use Push navigation.

export default class PushedScreen extends NavigationComponent<Props> {
  static options(): Options {
    return {
      topBar: {
        testID: PUSHED_SCREEN_HEADER,
        title: {
          text: 'Pushed Screen',
        },
        rightButtons: [
          {
            id: 'singleBtn',
            text: 'single',
            testID: TOP_BAR_BTN,
            icon: require('../../img/navicon_edit.png'), // Add icon
          },
        ],
        backButton: {
          testID: BACK_BUTTON,
          enableMenu: false,
        },
      },
    };
  }
...

In what environment did this happen?

React Native Navigation version: React Native version: Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: Device model: Android version:

d4vidi commented 5 months ago

@idutka the issue seems easy to reproduce. I'm working on tracking down the source - seems I have a lead.

d4vidi commented 3 months ago

Fix released in v7.38.4