infor-design / enterprise

Enterprise-grade component library for the Infor Design System
https://design.infor.com
Apache License 2.0
133 stars 81 forks source link

Datagrid: Autosizing not working correctly with tree grid #8646

Closed kwolentarski closed 1 week ago

kwolentarski commented 4 months ago

Describe the bug When using column auto-sizing in tree grid there are two issues occurring:

  1. Children content is not taken into consideration when column width is calculated
  2. Audible description of expand/collapse button is used as part of text when calculating the width, making the column wider than it needs to be.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://stackblitz.com/edit/ids-enterprise-4940-qethhi?file=index.js'
  2. Notice in first datagrid that the second row's (first child of first row) content is clipped.
  3. Notice in second datagrid that the first column is a lot wider than it needs to be.

Expected behavior

  1. Children of tree grid should be taken into consideration when calculating column width.
  2. Hidden text of expand/collapse button should not be taken into account when calculating column width.

Version

Platform

tmcconechy commented 4 months ago

@kwolentarski valid bug I guess but the auto column sizing is not very performant so maybe consider static widths? Additional checks might make it a bit slower

tmcconechy commented 2 weeks ago

@yohannahbautista thinking about this one... maybe

1) use existing calculateTextWidth which is used already for auto column width 2) For tree columns navigate all the children and find the max adding all the textWidths together 3) add some padding for the indenting ect