FocusCommand sets the Focus state on the model. When the model is in Focus it can receive keyboard input and the cursor will be hidden.
()
| 273 | // FocusCommand sets the Focus state on the model. When the model is in Focus it can |
| 274 | // receive keyboard input and the cursor will be hidden. |
| 275 | func (m *TextInputModel) FocusCommand() tea.Cmd { |
| 276 | m.Focus = true |
| 277 | m.blink = m.cursorMode == CursorHide // show the cursor unless we've explicitly hidden it |
| 278 | |
| 279 | if m.cursorMode == CursorBlink && m.Focus { |
| 280 | return m.blinkCmd() |
| 281 | } |
| 282 | return nil |
| 283 | } |
| 284 | |
| 285 | // Blur removes the Focus state on the model. When the model is blurred it can |
| 286 | // not receive keyboard input and the cursor will be hidden. |
no test coverage detected