mediacube-ui 0.1.52 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -497,7 +497,23 @@ export default {
497
497
  toggleColumns(val) {
498
498
  if (val) {
499
499
  const columns = this.$refs.xTable.getColumns()
500
- const hideColumns = columns.filter(col => col.fixed !== 'left')
500
+ let fixedColNeigbhorIndex
501
+ const hideColumns = columns.filter((col, i) => {
502
+ const isFixedCol = col.fixed === 'left'
503
+ /**
504
+ * Скрываем все столбцы кроме фиксированного и его соседа, чтобы не было рассинхрона при выходе из карточки
505
+ * т.к. когда остается 1 столбец, то фикс - размаунтится, а потом при выходе из карточки перерендеривается
506
+ * и скроллит в самый верх
507
+ * */
508
+ if (isFixedCol) fixedColNeigbhorIndex = i + 1
509
+ switch (true) {
510
+ case i === fixedColNeigbhorIndex:
511
+ return
512
+ default:
513
+ return !isFixedCol
514
+ }
515
+ return !isFixedCol
516
+ })
501
517
  hideColumns.forEach(col => (col.visible = false))
502
518
  this.$refs.xTable.refreshColumn()
503
519
  } else {