Skip to content

Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps()#162

Open
JeremieMercier wants to merge 1 commit into
NativePHP:mainfrom
JeremieMercier:patch-1
Open

Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps()#162
JeremieMercier wants to merge 1 commit into
NativePHP:mainfrom
JeremieMercier:patch-1

Conversation

@JeremieMercier

@JeremieMercier JeremieMercier commented Jun 13, 2026

Copy link
Copy Markdown

The toNativeProps() method in TopBar uses array_filter with fn ($value) => $value !== null && $value !== false, which silently drops boolean false values before sending props to the native layer. This
makes it impossible to disable show_navigation_icon — the prop is never transmitted, so the native side always falls back to its default (showing the icon).

Fix: align the filter with SideNavHeader, which correctly uses fn ($value) => $value !== null.

// Before
], fn ($value) => $value !== null && $value !== false);

// After
], fn ($value) => $value !== null);

Reproducible with:

<native:top-bar title="Test" :show-navigation-icon="false" />
{{-- hamburger still visible despite false --}}

…rops()

The toNativeProps() method in TopBar uses array_filter with fn ($value) => $value !== null && $value !== false, which silently drops boolean false values before sending props to the native layer. This
  makes it impossible to disable show_navigation_icon — the prop is never transmitted, so the native side always falls back to its default (showing the icon).

 Fix: align the filter with SideNavHeader, which correctly uses fn ($value) => $value !== null.

  // Before
  ], fn ($value) => $value !== null && $value !== false);

  // After
  ], fn ($value) => $value !== null);

  Reproducible with:

  <native:top-bar title="Test" :show-navigation-icon="false" />
  {{-- hamburger still visible despite false --}}
@JeremieMercier JeremieMercier changed the title Bug: show_navigation_icon: false is filtered out in TopBar::toNativeP… Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps() Jun 13, 2026
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.

1 participant