Text_input widget character limit

Hi there! My first question asked on iced.

Is there a way to impose a character limit on the text_input widget?

I looked and looked, but for the life of me I couldn’t figure out how to do this. Does iced provide this functionality? Thanks in advance and I apologize if this question has already been answered elsewhere that I have overlooked.

You would do this yourself in your update logic. If a character was written but the current text is already at the length limit, then you ignore the new character.

2 Likes

Thank you! This made me realize stuff I was not noticing in my code. I am now able to do this successfully. Thank you, sir!

1 Like