Tabulator star header filter does not inherit formatter star count
HTML
<script src="https://unpkg.com/tabulator-tables@6.5.3/dist/js/tabulator.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/tabulator-tables@6.5.3/dist/css/tabulator.min.css">
<h1>Tabulator star header filter reproduction</h1>
<p>
Both tables use a 10-star formatter. In the first table, the header
filter incorrectly falls back to 5 stars. The second table shows the
workaround using <code>headerFilterParams</code>.
</p>
<section>
<h2>Actual behavior: only 5 stars</h2>
<p>
The column uses <code>formatterParams: { stars: 10 }</code>, but its
header filter displays only 5 stars.
</p>
<div id="reproduction-table"></div>
</section>
<section>
<h2>Workaround: 10 stars</h2>
<p>
The same value must be duplicated in
<code>headerFilterParams: { stars: 10 }</code>.
</p>
<div id="workaround-table"></div>
</section>
CSS
body {
margin: 0;
padding: 2rem;
color: #253047;
background: #f5f6fa;
font-family: system-ui, sans-serif;
}
h1 {
margin-top: 0;
}
h2 {
margin-bottom: 0.5rem;
font-size: 1.15rem;
}
section {
margin-top: 2rem;
padding: 1.25rem;
border: 1px solid #d9dce5;
border-radius: 0.5rem;
background: white;
}
code {
padding: 0.1rem 0.3rem;
border-radius: 0.25rem;
background: #eef0f5;
}
.tabulator {
margin-top: 1rem;
}
JavaScript
const data = [
{ id: 1, rating: 2 },
{ id: 2, rating: 6 },
{ id: 3, rating: 10 },
];
new Tabulator("#reproduction-table", {
data: data,
layout: "fitColumns",
columns: [
{
title: "Rating — 10 stars expected",
field: "rating",
formatter: "star",
formatterParams: {
stars: 10,
},
headerFilter: "star",
headerFilterFunc: "<=",
minWidth: 300,
},
],
});
new Tabulator("#workaround-table", {
data: data,
layout: "fitColumns",
columns: [
{
title: "Rating — explicit workaround",
field: "rating",
formatter: "star",
formatterParams: {
stars: 10,
},
headerFilter: "star",
headerFilterParams: {
stars: 10,
},
headerFilterFunc: "<=",
minWidth: 300,
},
],
});