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