malzariey / filament-daterangepicker-filter

MIT License
105 stars 46 forks source link

customize clear icon #113

Closed buddhaCode closed 2 months ago

buddhaCode commented 2 months ago

I would like to change the clear button's icon. So I introduced a clearIcon() method.

AjithLalps commented 2 months ago

I have the same requirements and about to create a PR for it. Thank you @buddhaCode for the PR +1

AjithLalps commented 2 months ago

Small suggestion though, for me the function name icon() looks cleaner and readable than the name clearIcon(). Since we have only one icon for the widget I think it's safe to name the function as icon(). So we will have same naming like filament.

buddhaCode commented 2 months ago

@AjithLalps That sounds reasonable. I was checking if the picker component already inherits an icon() method from somewhere. That's not the case. But after thinking about it, I found out that this Picker component uses the HasAffixes trait and simply uses the suffixIcon() method. So introducing a clearIcon(), as proposed in this PR, is more or less redundant.

I would suggest the following changes to this PR:

@AjithLalps and @malzariey What do you think about that?

AjithLalps commented 2 months ago

Agreed+1

buddhaCode commented 2 months ago

Hmm it wasn't that easy. When the button is deactivated is just the suffix icon. But when it's active is a suffix action which an icon.

So basically I left every thing as it was and just changed clearIcon to icon :)

AjithLalps commented 2 months ago

Thank you @malzariey for merging the PR and thank you @buddhaCode for the PR.

buddhaCode commented 2 months ago

@AjithLalps It was a pleasure. Thanks for your feedback.

malzariey commented 2 months ago

Thanks !