╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ main_wasm.zig ────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
233 fn setTextInputValue(focus_id: u32, bytes: []const u8) !void { 234 const root_ptr = if (root) |*r| r else return error.NotStarted; 235 const root_focus = root_ptr.getFocus(); 236 const child = root_focus.children.get(focus_id) orelse return error.UnknownFocusId; 237 switch (child.focus.kind) { 238 .text_input, .text_input_password, .text_area => {}, 239 else => return error.NotATextInput, 240 } 241 const ti = session.text_inputs.get(focus_id) orelse return error.UnknownFocusId; 242 try ti.setContent(allocator, bytes); 243 // mirror the TTY behavior in Login.View.input: editing an input clears 244 // the stale failure flag so the "(invalid)" label doesn't linger after 245 // the user has typed a correction 246 session.data.login_failure = null; 247 } 248