Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: dropdown & input fixes

JovannMC3d6335c85017
diff --git a/src/lib/components/functional/Dropdown.svelte b/src/lib/components/functional/Dropdown.svelte
index fd4e29a..f377832 100644
--- a/src/lib/components/functional/Dropdown.svelte
+++ b/src/lib/components/functional/Dropdown.svelte
@@ -73,10 +73,11 @@
if (dropdown && !dropdown.contains(e.target as Node)) open = false;
};
- window.addEventListener("click", clickHandler);
+ window.addEventListener("click", clickHandler, true);
return () => {
- if (clickHandler) window.removeEventListener("click", clickHandler);
+ if (clickHandler)
+ window.removeEventListener("click", clickHandler, true);
};
});
@@ -150,7 +151,7 @@
class={clsx(
"col-start-1 row-start-1 min-w-0 font-body",
style === "inline" &&
- "truncate max-w-52 text-left underline underline-offset-3 decoration-dotted",
+ "truncate w-full md:max-w-52 text-left underline underline-offset-3 decoration-dotted",
style === "settings" && "text-left font-normal",
style === "default" && "text-center",
style !== "settings" && "font-medium",
diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelte
index b8ae53b..a42e12d 100644
--- a/src/lib/components/functional/FormatDropdown.svelte
+++ b/src/lib/components/functional/FormatDropdown.svelte
@@ -376,6 +376,12 @@
const listRect = formatList.getBoundingClientRect();
const optionRect = selectedOption.getBoundingClientRect();
+ // only scroll if button isnt fully visible
+ if (
+ optionRect.top >= listRect.top &&
+ optionRect.bottom <= listRect.bottom
+ )
+ return;
formatList.scrollTop += optionRect.top - listRect.top;
};
diff --git a/src/lib/components/functional/popups/SettingsModal.svelte b/src/lib/components/functional/popups/SettingsModal.svelte
index f87a09f..d49eecb 100644
--- a/src/lib/components/functional/popups/SettingsModal.svelte
+++ b/src/lib/components/functional/popups/SettingsModal.svelte
@@ -72,7 +72,8 @@
({ name, supportedFormats }) =>
converterCategoryByName.has(name) &&
supportedFormats.some(
- (format) => format.name === vertFile.from && format.isNative,
+ (format) =>
+ format.name === vertFile.from && format.isNative,
),
);
@@ -175,9 +176,8 @@
continue;
}
- const categories = await converter.getAvailableSettings(
- targetFile,
- );
+ const categories =
+ await converter.getAvailableSettings(targetFile);
const supportedKeys = new Set(
Object.values(categories)
.flat()
diff --git a/src/lib/css/app.scss b/src/lib/css/app.scss
index bf8ea00..15a0bd8 100644
--- a/src/lib/css/app.scss
+++ b/src/lib/css/app.scss
@@ -375,7 +375,7 @@ body {
input[type="text"],
select.dropdown {
- @apply w-full p-3 rounded-lg bg-panel border-2 border-button pl-3 pr-[4rem];
+ @apply w-full p-3 rounded-lg bg-panel border-2 border-button pl-3;
}
input[type="number"]::-webkit-inner-spin-button,