bugfixing
This commit is contained in:
parent
608d0a4b38
commit
d9dc0a0284
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { screenWidth } from "$lib/store";
|
import { screenWidth, stockTicker } from "$lib/store";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import Search from "lucide-svelte/icons/search";
|
import Search from "lucide-svelte/icons/search";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
@ -52,10 +52,11 @@
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async function handleSearch(event, symbol, assetType) {
|
async function handleSearch(symbol, assetType) {
|
||||||
event?.preventDefault();
|
|
||||||
searchBarTicker(symbol);
|
searchBarTicker(symbol);
|
||||||
goto(`/${assetType === "ETF" ? "etf" : assetType === "Crypto" ? "crypto" : "stocks"}/${symbol}`)
|
goto(`/${assetType === "ETF" ? "etf" : assetType === "Crypto" ? "crypto" : "stocks"}/${symbol}`)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function popularTicker(state) {
|
async function popularTicker(state) {
|
||||||
@ -92,7 +93,6 @@
|
|||||||
!state ||
|
!state ||
|
||||||
!searchBarData?.find((item) => item?.symbol === state?.toUpperCase())
|
!searchBarData?.find((item) => item?.symbol === state?.toUpperCase())
|
||||||
) {
|
) {
|
||||||
inputValue = "";
|
|
||||||
if ($screenWidth < 640) {
|
if ($screenWidth < 640) {
|
||||||
const closePopup = document.getElementById("searchBarModal");
|
const closePopup = document.getElementById("searchBarModal");
|
||||||
closePopup?.dispatchEvent(new MouseEvent("click"));
|
closePopup?.dispatchEvent(new MouseEvent("click"));
|
||||||
@ -125,8 +125,6 @@
|
|||||||
const closePopup = document.getElementById("searchBarModal");
|
const closePopup = document.getElementById("searchBarModal");
|
||||||
closePopup?.dispatchEvent(new MouseEvent("click"));
|
closePopup?.dispatchEvent(new MouseEvent("click"));
|
||||||
}
|
}
|
||||||
|
|
||||||
inputValue = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
@ -204,10 +202,8 @@
|
|||||||
}
|
}
|
||||||
const handleControlK = async (event) => {
|
const handleControlK = async (event) => {
|
||||||
if (event.ctrlKey && event.key === "k") {
|
if (event.ctrlKey && event.key === "k") {
|
||||||
|
|
||||||
//const keyboardSearch = document.getElementById("searchBarModal");
|
//const keyboardSearch = document.getElementById("searchBarModal");
|
||||||
//keyboardSearch?.dispatchEvent(new MouseEvent("click"));
|
//keyboardSearch?.dispatchEvent(new MouseEvent("click"));
|
||||||
touchedInput = true;
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -359,7 +355,7 @@
|
|||||||
class="cursor-pointer text-white border-b border-gray-600 last:border-none flex h-fit w-auto select-none items-center rounded-button py-3 pl-5 pr-1.5 text-sm capitalize outline-none transition-all duration-75 data-[highlighted]:bg-primary"
|
class="cursor-pointer text-white border-b border-gray-600 last:border-none flex h-fit w-auto select-none items-center rounded-button py-3 pl-5 pr-1.5 text-sm capitalize outline-none transition-all duration-75 data-[highlighted]:bg-primary"
|
||||||
value={item?.symbol}
|
value={item?.symbol}
|
||||||
label={item?.name}
|
label={item?.name}
|
||||||
on:click={(e) => handleSearch(e, item?.symbol, item?.type)}
|
on:click={() => handleSearch(item?.symbol, item?.type)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="flex flex-row items-center justify-between w-full">
|
class="flex flex-row items-center justify-between w-full">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user