╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ main_wasm.zig ────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
247 var buf: [256]u8 = undefined; 248 const str = std.fmt.bufPrint(&buf, "setTextInputValue: {}", .{err}) catch unreachable; 249 consoleLog(str); 250 }; 251 } 252 253 fn setTextInputValue(focus_id: u32, bytes: []const u8) !void { 254 const root_ptr = if (root) |*r| r else return error.NotStarted; 255 const root_focus = root_ptr.getFocus(); 256 const child = root_focus.children.get(focus_id) orelse return error.UnknownFocusId; 257 switch (child.focus.kind) { 258 .text_input, .text_input_password, .text_area => {}, 259 else => return error.NotATextInput, 260 } 261 const ti = session.text_inputs.get(focus_id) orelse return error.UnknownFocusId; 262 try ti.setContent(allocator, bytes); 263 } 264