ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
38 stars 4 forks source link

New-UDTable with StickyHeader and icon button issue #3310

Open kodifan opened 7 months ago

kodifan commented 7 months ago

Version

4.2.20

Severity

Low

Environment

msi

Steps to Reproduce

When you have a table with StickyHeader and button with one of the columns (and the size of table is fixed so you have to scroll thru the table) this icon button will overlap column label Simple code to reproduce:

New-UDApp -Title 'PowerShell Universal' -Content {
$Data = @(
     @{Dessert = 'Frozen yoghurt'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Gingerbread'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Frozen yoghurt'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
     @{Dessert = 'Gingerbread'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0}
 ) 
 $Columns = @(
     New-UDTableColumn -Property Dessert -Title "A Dessert"
     New-UDTableColumn -Property Calories -Title Calories 
     New-UDTableColumn -Property Fat -Title Fat 
     New-UDTableColumn -Property Carbs -Title Carbs 
     New-UDTableColumn -Property Protein -Title Protein -OnRender {New-UDIconButton -Icon trash -Size small}
 )
 New-UDPaper -Content {
    New-UDTable -Data $Data -Columns $Columns -Id 'table2' -StickyHeader -Dense
 } -Style @{height = '300px'}
}

Expected behavior

icon button not overlapping column label

Actual behavior

icon button overlapping column label

Additional Environment data

No response

Screenshots/Animations

image

kodifan commented 4 months ago

hello any progress on this - still exists in 4.3.0 image

kodifan commented 1 month ago

ok i found it - to mitigate this you need following line added :) $header_style = @{'zIndex' = 1} -StickyHeader -HeaderStyle $header_style in New-UDTable command parameters but it will be nice if it will be applied to automatically if StickyHeader is used...