Skip to content

Commit 5dc6a2d

Browse files
committed
[frontend] small fixes
1 parent 8105707 commit 5dc6a2d

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

frontend/src/components/Omnibox.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export const UrlInput: Component<
3636
}
3737
> = function (cx) {
3838
this.focusindex = 0;
39-
this.overflowItems = ["test", "test2", "test3", "test4", "test5"];
39+
this.overflowItems = [];
40+
this.value = "";
4041
const fetchSuggestions = async () => {
4142
let resp = await client.fetch(
4243
`http://suggestqueries.google.com/complete/search?client=chrome&q=${encodeURIComponent(this.input.value)}`
@@ -69,6 +70,11 @@ export const UrlInput: Component<
6970
return (
7071
<div
7172
on:click={(e: MouseEvent) => {
73+
if (this.active) {
74+
e.preventDefault();
75+
e.stopPropagation();
76+
return;
77+
}
7278
this.active = true;
7379
browser.unfocusframes = true;
7480
document.body.addEventListener("click", (e) => {
@@ -113,15 +119,13 @@ export const UrlInput: Component<
113119
on:keydown={(e: KeyboardEvent) => {
114120
if (e.key === "ArrowDown") {
115121
e.preventDefault();
116-
this.active = true;
117122
this.focusindex++;
118123
if (this.focusindex > this.overflowItems.length) {
119124
this.focusindex = 0;
120125
}
121126
}
122127
if (e.key === "ArrowUp") {
123128
e.preventDefault();
124-
this.active = true;
125129
this.focusindex--;
126130
if (this.focusindex < 0) {
127131
this.focusindex = this.overflowItems.length;

frontend/src/components/TabStrip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ export const Tabs: Component<
320320
});
321321

322322
const mouseDown = (e: MouseEvent, tab: Tab) => {
323+
if (e.button != 0) return;
323324
this.currentlydragging = tab.id;
324325

325326
const root = getTabFromIndex(tab.id);

frontend/src/main.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import "./style.css";
22

3+
// temp fix for vite not working
4+
import.meta.hot?.accept(() => location.reload());
5+
36
import { createBrowser } from "./browser";
47
import { createMenu } from "./components/Menu";
58
let app = document.getElementById("app")!;

frontend/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { scramjetPath } from "@mercuryworkshop/scramjet";
44
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
55

66
import { viteStaticCopy } from "vite-plugin-static-copy";
7-
console.log(epoxyPath, baremuxPath);
87

98
export default defineConfig({
109
plugins: [

0 commit comments

Comments
 (0)