bogdan / datagrid

Gem to create tables grids with sortable columns and filters
MIT License
1.02k stars 115 forks source link

Unable to set class attribute for select filter #319

Closed jkaufman closed 7 months ago

jkaufman commented 7 months ago

I am attempting to style the select filter using input_options. However, passing a value for class has no effect.


Declare a filter with input options specifying the class attribute:

filter(:name, :enum, input_options: {class: 'border-gray-300'}, select: proc { … })

Expected

The provided value for class either combines with or clobbers the default value:

<select class="border-gray-300" name="q[name]" id="q_name">

Actual

The generated HTML retains the default value for class: <select class="name enum_filter" name="q[name]" id="q_name">

bogdan commented 7 months ago

Fixed in 1.8.1. Please check.

jkaufman commented 7 months ago

Fix confirmed. The values are merged. Thank you!