Skip to content

Commit

Permalink
bug: fix svelte error effect_update_depth_exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Dec 28, 2024
1 parent f7690bc commit b66152d
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import {run} from 'svelte/legacy';
import {
basicColors,
transformColor,
Expand Down Expand Up @@ -61,20 +59,20 @@
};
// Check if the dropdown is actually active
run(() => {
$effect(() => {
if (innerDivRef !== null && onChange) {
onChange(selfColor.hex, $skipAddingToHistoryStack);
inputColor = selfColor.hex;
}
});
run(() => {
if (color) {
const newColor = transformColor('hex', color);
selfColor = newColor;
inputColor = newColor.hex;
}
});
// run(() => {
// if (color) {
// const newColor = transformColor('hex', color);
// selfColor = newColor;
// inputColor = newColor.hex;
// }
// });
</script>

<div
Expand Down

0 comments on commit b66152d

Please sign in to comment.