flet icon indicating copy to clipboard operation
flet copied to clipboard

Container overlapping ListTile properties

Open ClearSafety opened this issue 1 year ago • 0 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

ListTile properties like hover_color or bgcolor_activated or bgcolor are overlapped by Container properties like bgcolor or shadow. It's strange because normally the ListTile properties are displayed over the Container properties. For example, the property title from the ListTile displays its content over the Container, even if it's set to the Container a background colour.

It seems that this is a behaviour of this control. If instead of the ListTile you use the control Text as argument for the content of the Container, the bgcolor property of the Text overlap the bgcolor of the Container.

Similar problem was mentioned in the issue #3426. But the solution there doen't seem to apply here, because even using the ListTile within ListView, Column, it persists with the same problem.

Code sample

Code
import flet as ft

def main(page: ft.Page):

    page.add(
        ft.Container(
            shadow=ft.BoxShadow(color=ft.colors.GREY_200, blur_radius=5),
            border=ft.Border(
                top=ft.BorderSide(width=2, color=ft.colors.GREY_200),
                bottom=ft.BorderSide(width=2, color=ft.colors.GREY_200),
                right=ft.BorderSide(width=2, color=ft.colors.GREY_200),
                left=ft.BorderSide(width=2, color=ft.colors.GREY_200),
            ),
            border_radius=5,
            content=ft.ListTile(
                title=ft.Text('This is a test'),
                hover_color='red',
                on_click=lambda e: print('Test')
            )
        )
    )

ft.app(target=main)

To reproduce

  1. Run the reprocode.
  2. Hover the mouse over the option with the text 'This is a test'.

Expected behavior

I expected to see the properties of the ListTile overlapping the properties of the Container.

Screenshots / Videos

Captures

[Upload media here]

![Container displying the shadow](https://github.com/user-attachments/assets/5cc342aa-5933-4dea-8906-0f14239dda00) ![mouse_hovered](https://github.com/user-attachments/assets/7f58b36c-422b-4d12-bc5b-66266711acc6)

Operating System

Windows

Operating system details

Windows 11 Pro

Flet version

0.24.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

ClearSafety avatar Oct 04 '24 12:10 ClearSafety