mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(number-input): do not dispatch change event on initialization #561
Fixes #561
This commit is contained in:
parent
af1caf97bf
commit
9e5adfa986
1 changed files with 2 additions and 5 deletions
|
@ -103,7 +103,7 @@
|
|||
/** Obtain a reference to the input HTML element */
|
||||
export let ref = null;
|
||||
|
||||
import { createEventDispatcher, afterUpdate } from "svelte";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import Add16 from "carbon-icons-svelte/lib/Add16/Add16.svelte";
|
||||
import Subtract16 from "carbon-icons-svelte/lib/Subtract16/Subtract16.svelte";
|
||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte";
|
||||
|
@ -129,12 +129,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
afterUpdate(() => {
|
||||
dispatch("change", value);
|
||||
});
|
||||
|
||||
let inputValue = value;
|
||||
|
||||
$: dispatch("change", value);
|
||||
$: incrementLabel = translateWithId("increment");
|
||||
$: decrementLabel = translateWithId("decrement");
|
||||
$: value = Number(inputValue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue