Skip to content

Commit b407278

Browse files
robertmesserlejelbourn
authored andcommitted
fix(input): placeholder text is hidden by parent visibility (#680)
Previously, adding `visibility: hidden` to a parent element would not hide the placeholder text for inputs. Closes #670
1 parent 8df3246 commit b407278

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/input/input.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
3131
* Applies a floating placeholder above the input itself.
3232
*/
3333
@mixin md-input-placeholder-floating {
34-
visibility: visible;
34+
display: block;
3535
padding-bottom: 5px;
3636
transform: translateY(-100%) scale(0.75);
3737

@@ -103,15 +103,14 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
103103
left: 0;
104104
top: 0;
105105

106-
visibility: hidden;
107106
font-size: 100%;
108107
pointer-events: none; // We shouldn't catch mouse events (let them through).
109108
color: $md-input-placeholder-color;
110109
z-index: 1;
111110

112111
// Put ellipsis text overflow.
113112
width: 100%;
114-
display: block;
113+
display: none;
115114
white-space: nowrap;
116115
text-overflow: ellipsis;
117116
overflow-x: hidden;
@@ -123,7 +122,7 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
123122
color $swift-ease-out-duration $swift-ease-out-timing-function;
124123

125124
&.md-empty {
126-
visibility: visible;
125+
display: block;
127126
cursor: text;
128127
}
129128

0 commit comments

Comments
 (0)