Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Keavon committed Feb 5, 2025
1 parent d360601 commit a932289
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions frontend/src/components/widgets/inputs/NumberInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
export let incrementCallbackDecrease: (() => void) | undefined = undefined;
let self: FieldInput | undefined;
let isdragging: boolean;
isdragging = false;
let inputRangeElement: HTMLInputElement | undefined;
let text = displayText(value, unit);
let isDragging = false;
let editing = false;
// Stays in sync with a binding to the actual input range slider element.
let rangeSliderValue = value !== undefined ? value : 0;
Expand Down Expand Up @@ -189,9 +188,8 @@
editing = true;
self?.selectAllText(text);
if (isdragging) {
self?.unFocus();
}
// Workaround for weird behavior in Firefox: <https://github.com/GraphiteEditor/Graphite/issues/2215>
if (isDragging) self?.unFocus();
}
// Called only when `value` is changed from the <input> element via user input and committed, either with the
Expand Down Expand Up @@ -286,15 +284,15 @@
const onMove = () => {
if (alreadyActedGuard) return;
alreadyActedGuard = true;
isdragging = true;
isDragging = true;
beginDrag(e);
removeEventListener("pointermove", onMove);
};
// If it's a mouseup, we'll begin editing the text field.
const onUp = () => {
if (alreadyActedGuard) return;
alreadyActedGuard = true;
isdragging = false;
isDragging = false;
self?.focus();
removeEventListener("pointerup", onUp);
};
Expand Down

0 comments on commit a932289

Please sign in to comment.