Skip to content

Commit bc03770

Browse files
fix(ui): Handle more empty text inputs
1 parent a2ec36f commit bc03770

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/userscript/source/ui/components/UiComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export abstract class UiComponent extends EventTarget {
8585

8686
static promptPercentage(text: string, defaultValue: string): number | null {
8787
const value = window.prompt(text, defaultValue);
88-
if (value === null) {
88+
if (value === null || value === "") {
8989
return null;
9090
}
9191

@@ -111,7 +111,7 @@ export abstract class UiComponent extends EventTarget {
111111

112112
static promptFloat(text: string, defaultValue: string): number | null {
113113
const value = window.prompt(text, defaultValue);
114-
if (value === null) {
114+
if (value === null || value === "") {
115115
return null;
116116
}
117117

0 commit comments

Comments
 (0)