From 34d787674befec13abddb3dd13b9e2db525e4f03 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sun, 22 Dec 2024 17:44:41 +0300 Subject: [PATCH] fix max value --- resources/views/quantity.blade.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/views/quantity.blade.php b/resources/views/quantity.blade.php index 675c09e..c794220 100644 --- a/resources/views/quantity.blade.php +++ b/resources/views/quantity.blade.php @@ -49,7 +49,7 @@ x-data="{ state: $wire.$entangle('{{ $getStatePath }}'), - maxValue: @js($getMaxValue), + maxValue: @js($getMaxValue ?? 1000000), minValue: {{ $getMinValue ?? 0 }}, steps: {{ $getSteps ?? 1 }}, isDecrementAllowed: true, @@ -57,7 +57,6 @@ isDisabled: {{ $isDisabled ? 'true' : 'false' }}, increment() { if(! this.isDisabled && this.state < this.maxValue && this.state >= this.minValue){ - this.state = this.state + this.steps $wire.$refresh() if(this.state == this.maxValue){ @@ -71,9 +70,8 @@ decrement() { if(! this.isDisabled && this.state > 0 && this.state <= this.maxValue && this.state > this.minValue) { this.state = this.state - this.steps - $wire.$refresh() - if(this.state == this.minValue){ + if(this.state == this.minValue) { this.isDecrementAllowed = false } else { this.isIncrementAllowed = true