livewire-powergrid icon indicating copy to clipboard operation
livewire-powergrid copied to clipboard

[FIX] Filtering with Filter::number and methods: thousands() / decimal() not working

Open dansysanalyst opened this issue 1 year ago • 0 comments

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

  • [X] Bug fix
  • [ ] Enhancement
  • [ ] New feature
  • [ ] Breaking change

Description

This Pull Request fixes using the Filter::number with custom separators configured with `` and ->thousands(), ->decimal() methods.

  public function filters(): array
    {
        return [
            Filter::number('price_BRL', 'price')
                ->thousands('.')
                ->decimal(',')
                ->placeholder('lowest', 'highest'),
        ];
    }

The column displays prices formatted as #.###,##, and the filter should follow the same format for a better user experience.

Before

no

After

CleanShot 2024-05-09 at 02 06 02@2x

Related Issue(s)

Documentation

This PR requires Documentation update?

  • [ ] Yes
  • [X] No
  • [ ] I have already submitted a Documentation pull request.

dansysanalyst avatar May 09 '24 00:05 dansysanalyst