Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListFile hover_color not working as expected #3315

Closed
mvolar opened this issue May 17, 2024 · 1 comment
Closed

ListFile hover_color not working as expected #3315

mvolar opened this issue May 17, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@mvolar
Copy link

mvolar commented May 17, 2024

Description

According to #2710 the hoverColor for ListTile has been added, however it is not clear how to properly use it.

Code example to reproduce the issue:

import flet as ft

def main(page):
    page.title = "ListTile Examples"
    page.add(
        ft.Card(
            content=ft.Container(
                width=500,
                content=ft.Column(
                    [
                        ft.ListTile(
                            title=ft.Text("One-line list tile"), hover_color=ft.colors.BLUE,
                        )
                    ],
                    spacing=0,
                ),
                padding=ft.padding.symmetric(vertical=10),
            )
        )
    )

ft.app(target=main)

Describe the results you received:

I expected to see hover to trigger once my mouse gets over the tile, I can see in Flutter that the ListTile requires some additional complexity but I am unable to understand how to translate this to flet. Additionally I get no errors in the console running this code and the method is exposed.

Flet version (pip show flet):

Version: 0.22.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: C:\python\Lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by:

Operating system:

Windows

@ndonkoHenri
Copy link
Collaborator

ndonkoHenri commented May 17, 2024

You need to specify one of this properties too for hover_color to be shown: on_click, url or toggle_inputs=True. (ref)
on_click should be easier/better for your usecase.

Adding documentation label.

@ndonkoHenri ndonkoHenri added the documentation Improvements or additions to documentation label May 17, 2024
@mvolar mvolar closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants