TextInput is not updates when mask active
Hi, I have 2 TextInput in my form. When i update first input, it updates second input with some calculations. But after i add mask to input it not updates anymore.
Here is my code:
Calculate prices method does some calculations it's working but i set values like this:
Here is my code:
TextInput::make('producer_price')
->suffix('TL')
->label(__('product::filament.producer_price'))
->default(0)
->reactive()
->afterStateUpdated(function (\Closure $get, \Closure $set) {
self::calculatePrices($get, $set);
})
->lazy()
->mask(fn (TextInput\Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->decimalSeparator(',')
->mapToDecimalSeparator([','])
->minValue(1)
->maxValue(PHP_INT_MAX)
->normalizeZeros()
->padFractionalZeros()
->thousandsSeparator('.'),
),
TextInput::make('net_producer_price')
->label(__('product::filament.net_producer_price'))
->suffix('TL')
->default(0)
->required()
->mask(fn (TextInput\Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->decimalSeparator(',')
->mapToDecimalSeparator([','])
->minValue(1)
->maxValue(PHP_INT_MAX)
->normalizeZeros()
->padFractionalZeros()
->thousandsSeparator('.'),
),TextInput::make('producer_price')
->suffix('TL')
->label(__('product::filament.producer_price'))
->default(0)
->reactive()
->afterStateUpdated(function (\Closure $get, \Closure $set) {
self::calculatePrices($get, $set);
})
->lazy()
->mask(fn (TextInput\Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->decimalSeparator(',')
->mapToDecimalSeparator([','])
->minValue(1)
->maxValue(PHP_INT_MAX)
->normalizeZeros()
->padFractionalZeros()
->thousandsSeparator('.'),
),
TextInput::make('net_producer_price')
->label(__('product::filament.net_producer_price'))
->suffix('TL')
->default(0)
->required()
->mask(fn (TextInput\Mask $mask) => $mask
->numeric()
->decimalPlaces(2)
->decimalSeparator(',')
->mapToDecimalSeparator([','])
->minValue(1)
->maxValue(PHP_INT_MAX)
->normalizeZeros()
->padFractionalZeros()
->thousandsSeparator('.'),
),Calculate prices method does some calculations it's working but i set values like this:
$set('net_producer_price', $prices['net_producer_price']);$set('net_producer_price', $prices['net_producer_price']);