key -> focus chatbar

This commit is contained in:
2026-01-18 21:03:47 +01:00
parent ba2178613b
commit 2226d8bcfc

View File

@@ -7,12 +7,19 @@ import { ServerBar } from "@components/ServerBar.tsx";
export function App(): ReactElement {
const [serverName, setServerName] = useState("undefined");
window.addEventListener("keydown", (e) => {
if (e.ctrlKey || e.metaKey || e.altKey) return;
const chatbar = document.getElementById("editor");
chatbar?.focus();
chatbar?.onkeydown?.(e);
});
return (
<div>
<ServerBar setServerName={setServerName} currentServer={serverName} />
<ChannelBar servername={serverName} />
<RenderMessages />
<Chatbar />
<Chatbar channelName="undefined" />
</div>
)
}