From 29eee66ed8a05635a6206ae46c2a34f7550d7dbb Mon Sep 17 00:00:00 2001 From: mattselle Date: Mon, 9 Dec 2019 20:45:10 -0600 Subject: [PATCH] Fix Placeholder overlap issue (#1359) * Fix label overlap issue when value is provided https://github.com/ironmansoftware/universal-dashboard/issues/1330 * Placeholder should be active label and not overlap https://github.com/ironmansoftware/universal-dashboard/issues/921 * Revert "Placeholder should be active label and not overlap" This reverts commit 938fd373c10974c19a1aaa203a1fd953733dd53e. --- .../Tests/textbox.tests.ps1 | 9 +++++++++ src/UniversalDashboard/Controls/src/textbox.ps1 | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 b/src/UniversalDashboard.Materialize/Tests/textbox.tests.ps1 index 1ea52902..95c9f6c1 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..0683541c 100644 --- a/src/UniversalDashboard/Controls/src/textbox.ps1 +++ b/src/UniversalDashboard/Controls/src/textbox.ps1 @@ -40,7 +40,9 @@ function New-UDTextbox { } $LabelClassName = "" - if($Value){ + + if($Value -Or $Placeholder){ + $LabelClassName = "active" }