Skip to content

Tab label and indicator alignment issue with Flet >= 0.12 #2198

@girip11

Description

@girip11

When I use the Tabs snippet from this link with flet 0.10 or 0.11, it renders as shown in the snippet page. But the same snippet when used with Flet >= 0.12 onwards renders with the first tab label misaligned.

This is the snippet I used.

import flet as ft

def main(page: ft.Page):

    t = ft.Tabs(
        selected_index=1,
        animation_duration=300,
        tabs=[
            ft.Tab(
                text="Tab 1",
                content=ft.Container(
                    content=ft.Text("This is Tab 1"), alignment=ft.alignment.center
                ),
            ),
            ft.Tab(
                tab_content=ft.Icon(ft.icons.SEARCH),
                content=ft.Text("This is Tab 2"),
            ),
            ft.Tab(
                text="Tab 3",
                icon=ft.icons.SETTINGS,
                content=ft.Text("This is Tab 3"),
            ),
        ],
        expand=1,
    )

    page.add(t)

ft.app(target=main)

Output in Flet 0.10.3 or 0.11.0. This is what is also expected.

image

image

Output in Flet >=0.12.x onwards including 0.14.0

image
image

Operating system:
image

Additional environment details:
Python version 3.11.5

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcontrols

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions