yepsua / filament-range-field

Provides the missing range field for the Filament forms.
MIT License
31 stars 12 forks source link

How to get current slide value #13

Closed barovski closed 1 year ago

barovski commented 1 year ago

This is not a bug, because I have a 30 options I will hide the values below slider, but how to get current slide value when slider move?

Thanks

oyepez003 commented 1 year ago

You can use the reactive or lazy method if you need to do something in the form when the field value changes.

RangeSlider::make('range')
    ...
    ->reactive()
    ->afterStateUpdated(function (Closure $set, $state) {
      // Do anything you need
    })
    ...
barovski commented 1 year ago

Thanks, I want to show it in range-slider.blade.php, I'm not so familiar with livewire

oyepez003 commented 1 year ago

If you want to rewrite the template you can do it by publishing the templates and updating the file by yourself:

php artisan vendor:publish --tag="filament-range-field-views"