File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5768,8 +5768,24 @@ const FLEX_COLUMNS = new Set<string>([
57685768 CONST . SEARCH . TABLE_COLUMNS . TAX_RATE ,
57695769] ) ;
57705770
5771+ const TOTAL_COLUMNS = new Set < string > ( [
5772+ CONST . SEARCH . TABLE_COLUMNS . TOTAL ,
5773+ CONST . SEARCH . TABLE_COLUMNS . TOTAL_AMOUNT ,
5774+ CONST . SEARCH . TABLE_COLUMNS . TOTAL_PER_ATTENDEE ,
5775+ CONST . SEARCH . TABLE_COLUMNS . ORIGINAL_AMOUNT ,
5776+ ] ) ;
5777+
5778+ /**
5779+ * Returns true when it's safe to remove flex from total columns — i.e., another flex column
5780+ * exists to fill the space, and the total column is the last visible column.
5781+ */
57715782function hasFlexColumn ( columns ?: SearchColumnType [ ] ) : boolean {
5772- return ! ! columns ?. some ( ( col ) => FLEX_COLUMNS . has ( col ) ) ;
5783+ if ( ! columns ?. length ) {
5784+ return false ;
5785+ }
5786+ const lastColumn = columns . at ( - 1 ) ;
5787+ const isTotalLastColumn = ! ! lastColumn && TOTAL_COLUMNS . has ( lastColumn ) ;
5788+ return isTotalLastColumn && columns . some ( ( col ) => FLEX_COLUMNS . has ( col ) ) ;
57735789}
57745790
57755791export {
You can’t perform that action at this time.
0 commit comments