editDone completes editing and copies the active edited text to the [TextField.text]. It is called when the return key is pressed or the text field goes out of focus.
()
| 517 | // editDone completes editing and copies the active edited text to the [TextField.text]. |
| 518 | // It is called when the return key is pressed or the text field goes out of focus. |
| 519 | func (tf *TextField) editDone() { |
| 520 | if tf.edited { |
| 521 | tf.edited = false |
| 522 | tf.text = string(tf.editText) |
| 523 | tf.SendChange() |
| 524 | // widget can be killed after SendChange |
| 525 | if tf.This == nil { |
| 526 | return |
| 527 | } |
| 528 | } |
| 529 | tf.clearSelected() |
| 530 | tf.clearCursor() |
| 531 | } |
| 532 | |
| 533 | // revert aborts editing and reverts to the last saved text. |
| 534 | func (tf *TextField) revert() { |
no test coverage detected