Skip to content

Commit

Permalink
fix max value
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Dec 22, 2024
1 parent 84369ed commit 34d7876
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions resources/views/quantity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@

x-data="{
state: $wire.$entangle('{{ $getStatePath }}'),
maxValue: @js($getMaxValue),
maxValue: @js($getMaxValue ?? 1000000),
minValue: {{ $getMinValue ?? 0 }},
steps: {{ $getSteps ?? 1 }},
isDecrementAllowed: true,
isIncrementAllowed: true,
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){
Expand All @@ -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
Expand Down

0 comments on commit 34d7876

Please sign in to comment.