flet icon indicating copy to clipboard operation
flet copied to clipboard

Disable text wrapping on multitext TextField

Open IdkWhatToCallMe123 opened this issue 1 year ago • 1 comments

Duplicate Check

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

Describe the requested feature

I want to be able to disable text wrapping on multitext Textfield

Suggest a solution

No response

Screenshots

No response

Additional details

No response

IdkWhatToCallMe123 avatar Oct 10 '24 13:10 IdkWhatToCallMe123

Flutter seems not to have a direct solution for this. However, with the help of this SO thread, I came up with this:

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.ListView(
            expand=True,
            horizontal=True,
            controls=[
                ft.Container(
                    width=1000,
                    content=ft.TextField(
                        hint_text="Enter your text here",
                        keyboard_type=ft.KeyboardType.MULTILINE,
                        text_vertical_align=ft.VerticalAlignment.START,
                        border=ft.InputBorder.UNDERLINE,
                        filled=True,
                        fit_parent_size=True,
                    ),
                )
            ],
        )
    )


ft.app(target=main)

You can't try it right now, as it makes use of a prop which will be available when #4105 gets merged.

ndonkoHenri avatar Oct 10 '24 16:10 ndonkoHenri

You can give the above code a try.

ndonkoHenri avatar Dec 09 '24 23:12 ndonkoHenri