GithubHelp home page GithubHelp logo

Comments (2)

hahelui avatar hahelui commented on June 26, 2024

Yeah, same here. I noticed that issue, and now I can't develop my app further because of it. The problem appears to be caused by putting ft.AutoComplete inside an ft.Row. You can put it inside an ft.ResponsiveRow, but it will stretch and expand, leaving no space for the other elements in the same row.

After experimenting more with the widget, I found that you can place it as a child of ft.Stack and change the width of the stack to the desired size. Then, wrap everything inside ft.ResponsiveRow, and it sort of works, but the suggestion's dropdown will not follow the stack size or the widget width.

Screenshot_20240522_090338

However, there's a bigger problem: Sadly, ft.AutoComplete is not supported yet on Android or iOS. I don't know why, maybe the widget is still under development.

Screenshot_20240522-090626
The same problem on IOS

from flet.

hahelui avatar hahelui commented on June 26, 2024

By the way, this is how I did it if that can help your case:
But don't close The Issue because the problems are not fixed yet.

import flet as ft


def main(page: ft.Page):
    list_example = ["one 1", "two 2", "three 3"]
    auto_complete = ft.AutoComplete(
        suggestions=[ft.AutoCompleteSuggestion(value=i) for i in list_example],
        on_select=lambda e: print(e.selection),
    )
    text_file = ft.TextField(width=400)
    page.add(ft.Row([ft.Column([text_file, ft.Stack(controls=[auto_complete],width=400)]),
                                ft.Column([text_file, ft.Stack(controls=[auto_complete],width=400)])]))


ft.app(target=main)

from flet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.