File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG.md
22
3+ ## 0.33.1 (unreleased)
4+
5+ - Fix a bug where the table component would not format numbers if sorting was not enabled.
6+ - Fix a bug with date sorting in the table component.
7+
8+
39## 0.33.0 (2025-02-15)
410
511### 1. Routing & URL Enhancements 🔀
Original file line number Diff line number Diff line change @@ -100,13 +100,16 @@ function apply_number_formatting(table_el) {
100100 * @param {HTMLElement[] } sort_buttons
101101 */
102102function table_parse_data ( table_el , sort_buttons ) {
103+ const is_num = [ ...sort_buttons ] . map (
104+ ( btn_el ) => btn_el . parentElement . dataset . column_type === "number" ,
105+ ) ;
103106 return [ ...table_el . querySelectorAll ( "tbody tr" ) ] . map ( ( tr_el ) => {
104107 const cells = tr_el . getElementsByTagName ( "td" ) ;
105108 return {
106109 el : tr_el ,
107110 sort_keys : sort_buttons . map ( ( btn_el , idx ) => {
108111 const str = cells [ idx ] ?. textContent ;
109- const num = Number . parseFloat ( str ) ;
112+ const num = is_num [ idx ] ? Number . parseFloat ( str ) : Number . NaN ;
110113 return { num, str } ;
111114 } ) ,
112115 } ;
You can’t perform that action at this time.
0 commit comments