Improve NumberInput with dragging to change value and escape/right-click to abort (#1469)

* Improve NumberInput with dragging to change value and escape to abort

Closes #1468

* Fix slowing with Shift and integer mode
This commit is contained in:
Keavon Chambers
2023-11-21 17:26:28 -08:00
committed by GitHub
parent da4d95fa7b
commit 34c6c0431b
9 changed files with 488 additions and 151 deletions
@@ -93,7 +93,7 @@
{/if}
{@const curvesInput = narrowWidgetProps(component.props, "CurveInput")}
{#if curvesInput}
<CurveInput {...exclude(curvesInput)} on:value={({ detail }) => debouncer((value) => updateLayout(index, value), { debounceTime: 120 }).updateValue(detail)} />
<CurveInput {...exclude(curvesInput)} on:value={({ detail }) => debouncer((value) => updateLayout(index, value), { debounceTime: 120 }).debounceUpdateValue(detail)} />
{/if}
{@const dropdownInput = narrowWidgetProps(component.props, "DropdownInput")}
{#if dropdownInput}
@@ -127,7 +127,7 @@
{#if numberInput}
<NumberInput
{...exclude(numberInput)}
on:value={({ detail }) => debouncer((value) => updateLayout(index, value)).updateValue(detail)}
on:value={({ detail }) => debouncer((value) => updateLayout(index, value)).debounceUpdateValue(detail)}
incrementCallbackIncrease={() => updateLayout(index, "Increment")}
incrementCallbackDecrease={() => updateLayout(index, "Decrement")}
sharpRightCorners={nextIsSuffix}