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: issue with input floating label and search type #1863

Merged
merged 3 commits into from
Nov 23, 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions packages/components/src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

// 1px for border
$icon-padding: calc(
#{form-components.$font-size-height} + 2 * #{variables.$db-spacing-fixed-sm} -
1px
#{form-components.$font-size-height} + #{variables.$db-spacing-fixed-sm} + #{variables.$db-spacing-fixed-xs}
);

.db-input {
Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/styles/_form-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ $floating-label-size: calc(
inset-block-start: calc(
(#{variables.$db-sizing-md} - #{$font-size-height}) / 2
);
inset-inline: #{variables.$db-spacing-fixed-sm};
inset-inline: var(
--db-form-component-padding-inline-start,
#{variables.$db-spacing-fixed-sm}
);
}

// icons
Expand Down
100 changes: 100 additions & 0 deletions showcases/shared/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,105 @@
}
}
]
},
{
"name": "Example - Types - Floating Label",
"examples": [
{
"name": "(Default) Text",
"props": {
"label": "Label",
"labelVariant": "floating"
}
},
{
"name": "Password",
"props": {
"label": "Label",
"type": "password",
"labelVariant": "floating"
}
},
{
"name": "Search",
"props": {
"label": "Label",
"type": "search",
"labelVariant": "floating"
}
},
{
"name": "E-Mail",
"props": {
"label": "Label",
"type": "email",
"labelVariant": "floating"
}
},
{
"name": "Number",
"props": {
"label": "Label",
"type": "number",
"labelVariant": "floating"
}
},
{
"name": "Tel",
"props": {
"label": "Label",
"type": "tel",
"labelVariant": "floating"
}
},
{
"name": "URL",
"props": {
"label": "Label",
"type": "url",
"labelVariant": "floating"
}
},
{
"name": "Date",
"props": {
"label": "Label",
"type": "date",
"labelVariant": "floating"
}
},
{
"name": "Datetime Local",
"props": {
"label": "Label",
"type": "datetime-local",
"labelVariant": "floating"
}
},
{
"name": "Month",
"props": {
"label": "Label",
"type": "month",
"labelVariant": "floating"
}
},
{
"name": "Time",
"props": {
"label": "Label",
"type": "time",
"labelVariant": "floating"
}
},
{
"name": "Week",
"props": {
"label": "Label",
"type": "week",
"labelVariant": "floating"
}
}
]
}
]
Loading