AddClearButton adds a trailing icon button at the end of the text field that clears the text in the text field when it is clicked.
()
| 489 | // of the text field that clears the text in the text field |
| 490 | // when it is clicked. |
| 491 | func (tf *TextField) AddClearButton() *TextField { |
| 492 | return tf.SetTrailingIcon(icons.Close, func(e events.Event) { |
| 493 | tf.clear() |
| 494 | }) |
| 495 | } |
| 496 | |
| 497 | // SetTypePassword enables [TextField.NoEcho] and adds a trailing |
| 498 | // icon button at the end of the textfield that toggles [TextField.NoEcho]. |