Skip to content

bug: NavigationBarDestination.selected_icon: ft.Icon renders as solid rectangle/blank background; ft.Icons.* works #6460

@5PIterator

Description

@5PIterator

Duplicate Check

Describe the bug

When selected_icon is set to an ft.Icon control (e.g. ft.Icon(ft.Icons.HOME, ...)), the destination’s selected state is drawn as a solid opaque block (grey/black in practice) instead of the icon. Using the icon enum directly (e.g. selected_icon=ft.Icons.HOME) works as expected.

Code sample

import flet as ft
def main(page: ft.Page):
    page.navigation_bar = ft.NavigationBar(
        destinations=[
            ft.NavigationBarDestination(
                icon=ft.Icons.HOME_OUTLINED,
                selected_icon=ft.Icons.HOME,  # OK
                label="Home",
            ),
            ft.NavigationBarDestination(
                icon=ft.Icons.SETTINGS_OUTLINED,
                selected_icon=ft.Icon(ft.Icons.SETTINGS),  # Broken: solid block
                label="Settings",
            ),
        ],
        on_change=lambda e: print(e.control.selected_index),
    )
ft.app(main)

To reproduce

Create a ft.NavigationBar with at least two ft.NavigationBarDestination items.
On one destination, set icon to an enum (or another working form) and selected_icon to ft.Icon(ft.Icons.SOME_ICON, ...) (not the bare enum).
Run the app and select that destination so the selected icon is shown.

Expected behavior

The selected destination should show the same glyph as when using selected_icon=ft.Icons.SOME_ICON, with normal Material navigation bar styling (e.g. pill background + icon + label if configured).

Screenshots / Videos

Image

Operating System

Windows

Operating system details

Windows 11

Flet version

0.83.0

Regression

No, it isn't

Suggestions

No response

Logs

No response

Additional details

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

👀 In review

Relationships

None yet

Development

No branches or pull requests

Issue actions