╭ changed ────────╮ │src/main_wasm.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 92 const root_focus = root_ptr.getFocus(); │ │ 93 if (root_focus.grandchild_id) |gid| { │ │ 94 if (root_focus.children.get(gid)) |child| { │ │ 95 - // browser-focus the focused overlay control (text input or submit button) │ │ 96 - // so the browser handles typing and Enter-to-submit natively. without this │ │ 97 - // the submit button never gets focus and Enter falls through to the wasm. │ │ 95 + // browser-focus the focused overlay control (text input, submit button │ │ 96 + // or file picker) so the browser handles typing, Enter-to-submit and │ │ 97 + // Enter-to-open-the-picker natively. without this the control never │ │ 98 + // gets focus and Enter falls through to the wasm. │ │ 99 switch (child.focus.kind) { │ │100 .text_input, .text_input_password, .text_area => _focusInput(@intCast(gid)), │ │100 - .custom => |custom| if (std.mem.eql(u8, custom, "submit")) _focusInput(@intCast(gid)), │ │101 + .custom => |custom| if (std.mem.eql(u8, custom, "submit") or std.mem.startsWith(u8, custom, ui.file_input_prefix)) _focusInput(@intCast(gid)),│ │102 else => {}, │ │103 } │ │104 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │136 _navigate(url.ptr, @intCast(url.len)); │ │137 return; │ │138 } │ │139 + // follow a link to bytes the server serves directly│ │140 + if (ui.rawLink(root_ptr.getFocus(), gid)) |url| { │ │141 + _navigate(url.ptr, @intCast(url.len)); │ │142 + return; │ │143 + } │ │144 } │ │145 } │ │146 │ ╰─────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │155 _navigate(url.ptr, @intCast(url.len)); │ │156 return; │ │157 } │ │158 + // the grid suppresses the anchor's own navigation, so follow it here│ │159 + if (ui.rawLink(root_ptr.getFocus(), focus_id)) |url| { │ │160 + _navigate(url.ptr, @intCast(url.len)); │ │161 + return; │ │162 + } │ │163 root_ptr.getFocus().setFocus(focus_id); │ │164 } │ │165 │ ╰──────────────────────────────────────────────────────────────────────────────╯