Skip to content

[Bug]: Widgets do not show up when enabled #582

@gabriel11447

Description

@gabriel11447

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Using prop to enable Map UI Widgets (compass, speedometer, speed limit, etc) doesn't work. I'm using a const that is set to true after re-rendered when Navigation is ready, then it works.

React Native version

0.81.5

React version

19.1.10

Package version

0.14.2

Native SDK versions

  • I haven't changed the version of the native SDKs

React Native Doctor Output

Common
✓ Node.js - Required to execute JavaScript code
✓ npm - Required to install NPM dependencies
✓ Watchman - Used for watching changes in the filesystem when in development mode
● Metro - Metro Bundler is not running

Android
✖ Adb - No devices and/or emulators connected. Please create emulator with Android Studio or connect Android device.
✖ JDK - Required to compile Java code

  • Version found: 21.0.2
  • Version supported: >= 17 <= 20
    ✓ Android Studio - Required for building and installing your app on Android
    ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
    ✓ Gradlew - Build tool required for Android builds
    ✖ Android SDK - Required for building and installing your app on Android
  • Versions found: 30.0.3, 31.0.0, 33.0.0, 33.0.1, 34.0.0, 35.0.0
  • Version supported: Not Found

iOS
✓ Xcode - Required for building and installing your app on iOS
✓ Ruby
✓ CocoaPods - Required for installing iOS dependencies
✓ .xcode.env - File to customize Xcode environment

Steps to reproduce

If I set compassEnabled={true} the compass does not show up.
I've have created an workaround using compassEnabled={UIWidgetsEnabled} using const UIWidgetsEnabled = navigationInitialized and navigationInitialized is set to true inside onNavigationReady callback

Expected vs Actual Behavior

It should work when set to true, but only works using some other value that changes after re-rendering

Code Sample

<NavigationView
          androidStylingOptions={{
            primaryDayModeThemeColor: palette.primary,
            secondaryDayModeThemeColor: palette.primarydark,
            primaryNightModeThemeColor: palette.primary,
            secondaryNightModeThemeColor: palette.primarydarker,
          }}
          iOSStylingOptions={{
            navigationHeaderPrimaryBackgroundColor: palette.primary,
            navigationHeaderSecondaryBackgroundColor: palette.primarydark,
          }}
          // Declarative UI props (migrate from controller methods)
          speedometerEnabled={UIWidgetsEnabled}
          speedLimitIconEnabled={UIWidgetsEnabled}
          headerEnabled={true}
          footerEnabled={false}
          compassEnabled={UIWidgetsEnabled}
          recenterButtonEnabled={true}
          reportIncidentButtonEnabled={false}
          trafficIncidentCardsEnabled={false}
          trafficPromptsEnabled={false}
          tripProgressBarEnabled={false}
          myLocationEnabled={true}
          myLocationButtonEnabled={false}
          onMapReady={onMapReady}
          onRecenterButtonClick={onRecenterButtonClick}
          onMapViewControllerCreated={setMapViewController}
          onNavigationViewControllerCreated={setNavigationViewController}
          navigationNightMode={
            theme === "dark"
              ? NavigationNightMode.FORCE_NIGHT
              : NavigationNightMode.FORCE_DAY
          }
/>

Additional Context

No response

Metadata

Metadata

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions