diff --git a/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 b/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 index 1ea52902..ce55a5c6 100644 --- a/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 +++ b/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 @@ -17,4 +17,13 @@ Describe "Textbox" { Find-SeElement -ClassName 'active' -Driver $Driver | should be $true } } + + Context "textbox placeholder" { + Set-TestDashboard -Content { + New-UDTextbox -Id 'EndTimestamp' -Label 'EndTimestamp' -Placeholder (Get-Date).ToString('yyyy.MM.dd HH:mm:ss.fff') + } + It "should be active" { + Find-SeElement -ClassName 'active' -Driver $Driver | should be $true + } + } } \ No newline at end of file diff --git a/src/UniversalDashboard/Controls/src/textbox.ps1 b/src/UniversalDashboard/Controls/src/textbox.ps1 index b3a55ea4..f7e7e3bd 100644 --- a/src/UniversalDashboard/Controls/src/textbox.ps1 +++ b/src/UniversalDashboard/Controls/src/textbox.ps1 @@ -40,7 +40,7 @@ function New-UDTextbox { } $LabelClassName = "" - if($Value){ + if($Value -Or $Placeholder){ $LabelClassName = "active" }