flet icon indicating copy to clipboard operation
flet copied to clipboard

button keeps on bouncing when at end of TextField in Stack

Open Vivekananda-Mullangi opened this issue 3 years ago • 2 comments

whenever I get the text cursor close to the button, the button keeps on bouncing. is there a way to stop it?

my code:

import flet
from flet import Page, Stack, TextField, padding, colors, icons, IconButton, theme, ButtonStyle

def main(page : Page):
    page.theme = theme.Theme(color_scheme_seed='lightblue')
    userinputs = Stack(expand=False)
    messageinput = TextField(
        height=30,
        content_padding=padding.only(left=12, right=45, top=7),
        border_width=0.5,
        border_radius=100,
    )

    sendbtn = IconButton(
        icon=icons.SEND,
        icon_color='lightblue',
        icon_size=25,
        tooltip='send message',
        right=0,
        top= -5,
        style=ButtonStyle(
                overlay_color=colors.TRANSPARENT,
            ),
    )
    userinputs.controls = [messageinput, sendbtn] 
    page.add(userinputs)

flet.app(target=main)

to recreate the problem, type till the end of the TextField.

Note: I am using Stack because the TextField expands with an increase in windows size. if there is a way to make the textfield to expand without using Stack, I would love to hear it.

Vivekananda-Mullangi avatar Aug 16 '22 13:08 Vivekananda-Mullangi

What do you mean by "bouncing"? Could you drop a simple recording please?

It looks pretty good on Windows:

2022-08-16_07h51_48

FeodorFitsner avatar Aug 16 '22 14:08 FeodorFitsner

sYMIOtf0zc

I am using windows (windows 11) too but the button bounces whenever the text cursor gets close to it.

Note: I couldn't capture it but the button bounces every time the text cursor gets close to it.

Vivekananda-Mullangi avatar Aug 17 '22 14:08 Vivekananda-Mullangi

Have you tried adding some padding to a TextField?

FeodorFitsner avatar Aug 27 '22 18:08 FeodorFitsner