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(styles): input and select disabled placeholder #4932

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bundlesize.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files": [
{
"path": "./dist/packages/styles/dist/fundamental-styles.css",
"maxSize": "140 kB"
"maxSize": "150 kB"
}
]
}
2 changes: 2 additions & 0 deletions packages/styles/src/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ $fd-input-field-height--compact: 1.625rem;

@if ($supportsText) {
&::placeholder {
opacity: 0;
color: var(--fdInput_Non_Interactive_State_Placeholder_Color);
}
}
Expand All @@ -249,6 +250,7 @@ $fd-input-field-height--compact: 1.625rem;

@if ($supportsText) {
&::placeholder {
opacity: 0;
color: var(--fdInput_Non_Interactive_State_Placeholder_Color);
}
}
Expand Down
14 changes: 14 additions & 0 deletions packages/styles/src/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,25 @@ $fd-select-padding-x-compact: 0.5rem;
--fdSelect_Min_Width: 5rem;
}

&[aria-selected='false'] {
.#{$block}__text-content {
visibility: hidden;
}
}

.#{$block}__button {
opacity: 0;
}
}

@include fd-disabled() {
&[aria-selected='false'] {
.#{$block}__text-content {
visibility: hidden;
}
}
}

&[aria-selected='false'] {
.#{$block}__text-content {
font-style: italic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<br />
<div class="fd-form-item">
<label class="fd-form-label" for="input-05">Disabled Input:</label>
<input class="fd-input" type="text" id="input-05" disabled value="Field placeholder text" placeholder="Field placeholder text">
<input class="fd-input" type="text" id="input-05" disabled placeholder="Field placeholder text">
</div>
<br />
<div class="fd-form-item">
Expand Down
4 changes: 2 additions & 2 deletions packages/styles/stories/Components/select/cozy.example.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</div>

<div style="height: 100px">
<label class="fd-form-label" id="cozySelectLabel">Disabled, Placeholder text</label><br />
<label class="fd-form-label" id="cozySelectLabel">In disabled state placeholder should not be visible</label><br />
<div class="fd-popover">
<div class="fd-popover__control" aria-expanded="false" aria-haspopup="true">
<div class="fd-select">
Expand All @@ -137,7 +137,7 @@
</div>

<div style="height: 100px">
<label class="fd-form-label" id="cozySelectLabel">Read Only, Placeholder text</label><br />
<label class="fd-form-label" id="cozySelectLabel">In read-only state placeholder should not be visible</label><br />
<div class="fd-popover">
<div class="fd-popover__control" aria-expanded="false" aria-haspopup="true">
<div class="fd-select">
Expand Down
Loading