Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for RowHoverSelect in function New-HTMLTableStyle #363

Open
linefeed1 opened this issue Jan 24, 2023 · 7 comments
Open

Fix for RowHoverSelect in function New-HTMLTableStyle #363

linefeed1 opened this issue Jan 24, 2023 · 7 comments
Labels
question Further information is requested

Comments

@linefeed1
Copy link

There appears to be at bug in PSWriteHTML.psm1- v.0.0.180 -> Function New-HTMLTableStyle as RowHoverSelected will show hover on selected item for odd row numbers only - after line 22918 added:
'table.dataTable.hover tbody tr.even:hover.selected, table.dataTable.display tbody tr.even:hover.selected'
'table.dataTable.hover tbody tr.odd:hover.selected, table.dataTable.display tbody tr.odd:hover.selected'

Verification:
New-HTMLTableStyle -BackgroundColor Blue -Type RowSelected
New-HTMLTableStyle -BackgroundColor Yellow -Type RowHover
New-HTMLTableStyle -BackgroundColor Yellow -Type RowHoverSelected

Hopefully this will help everyone who uses this functionality.

@PrzemyslawKlys
Copy link
Member

Why don't you create PR, modifying the source https://github.com/EvotecIT/PSWriteHTML/blob/master/Public/New-HTMLTableStyle.ps1 so we can add it to the original release?

@PrzemyslawKlys PrzemyslawKlys added the bug Something isn't working label Apr 8, 2023
@PrzemyslawKlys PrzemyslawKlys added question Further information is requested and removed bug Something isn't working labels Apr 20, 2023
@PrzemyslawKlys
Copy link
Member

RowHoverSelect

I've tried to see what you mean but I can't confirm your issue. Can you please explain or show what it is about?

@linefeed1
Copy link
Author

This appears to effect selected rows (highlighted in blue) only in hover mode.

In the demo you appear to only select one row at time and choose hover on an odd row (#7) but if you try to select multiple rows or a block with a click and holding down shift select several rows above then you'll have a block of selected rows to test/hover against. It's interesting as you happen to choose row 7 in the demo above which is odd and is designed verification route and it works for you.

Sorry for the miscommunication and hopefully this clarifies the issue.

@linefeed1
Copy link
Author

demo

@PrzemyslawKlys
Copy link
Member

PrzemyslawKlys commented Apr 20, 2023

Weird

I guess I've even weirder behavior. This is in Edge ;)

$ProcessesAll = Get-Process | Select-Object -First 10 -Property Name, Id, StartTime

New-HTML -TitleText 'Title' -Online -FilePath $PSScriptRoot\Example-SearchBuilder.html -ShowHTML {
    New-HTMLTableStyle -BackgroundColor Blue -Type RowSelected
    New-HTMLTableStyle -BackgroundColor Yellow -Type RowHover
    New-HTMLTableStyle -BackgroundColor Yellow -Type RowHoverSelected

    New-HTMLSection -HeaderText 'Search Builder 1' {
        New-HTMLTable -DataTable $ProcessesAll -SearchBuilder -Buttons excelHtml5, copyHtml5, csvHtml5 {

        }
    }
    New-HTMLSection -HeaderText 'Search Builder as button' {
        New-HTMLTable -DataTable $ProcessesAll
    }
    # This won't really work - button + searchBuilder
    New-HTMLSection -HeaderText 'Search Builder + button' {
        # Search Builder will be disabled, button will work
        New-HTMLTable -DataTable $ProcessesAll -SearchBuilder
    }
}

@linefeed1
Copy link
Author

Perhaps the code base has changed as the baseline mentioned was a change to PSWriteHTML.psm1 v.0.0.180 from the package here: https://www.powershellgallery.com/packages/PSWriteHTML/0.0.180

@kieranwalsh
Copy link

I also have this problem, but only when you add New-HTMLTableStyle -Type Table

for example:
$Processes = Get-Process | Select-Object -First 5 -Property *

New-HTML -TitleText 'Title' -Online -ShowHTML {
New-HTMLTableStyle -Type RowSelected -TextColor '#ffffff' -BackgroundColor '#25006D'
New-HTMLTableStyle -Type RowHover -TextColor '#ffffff' -BackgroundColor '#25006D'
New-HTMLTableStyle -Type RowHoverSelected -TextColor '#ffffff' -BackgroundColor '#25006D'
New-HTMLTableStyle -Type Table -TextColor '#000000' -BackgroundColor '#ffffff'
New-HTMLSection -HeaderText 'Search Builder as button' {
New-HTMLTable -DataTable $Processes
}
}

You'll see that it fails to highlight the even rows, but if you comment out the New-HTMLTableStyle -Type Table -TextColor '#000000' -BackgroundColor '#ffffff' line it'll work.

This is the same in Firefox and Edge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants