flet
flet copied to clipboard
button keeps on bouncing when at end of TextField in Stack
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.
What do you mean by "bouncing"? Could you drop a simple recording please?
It looks pretty good on Windows:


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.
Have you tried adding some padding to a TextField?