key -> focus chatbar
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user