Skip to content

textarea/textinput: control characters in input cause misbehavior/crashes during navigation #263

@knz

Description

@knz

If I trick textarea/textinput to accept control characters in its input (most easily, by using control characters in the input of SetValue, but also possible via bug #466, textarea/textinput get confused:

  • the width computation for the control characters is wrong
  • navigating the cursor from a line containing control characters to the previous/next line can cause the bubble to panic (because the width computation is wrong)

This is most noticeable when inserting a Tab character (ASCII 9) but some other control characters also display weird behavior.

FWIW, the patch in #214 fixes this by using the (new) function tea.SanitizeRunes on the input string. I'm not sure that's the best approach, but it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions