Skip to content

Commit 3031bc3

Browse files
authored
fix: issue with input floating label and search type (#1863)
1 parent 0cd1a41 commit 3031bc3

File tree

7 files changed

+105
-3
lines changed

7 files changed

+105
-3
lines changed
16.7 KB
Loading
24.5 KB
Loading
17.9 KB
Loading
13.2 KB
Loading

packages/components/src/components/input/input.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

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

1716
.db-input {

packages/components/src/styles/_form-components.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ $floating-label-size: calc(
5050
inset-block-start: calc(
5151
(#{variables.$db-sizing-md} - #{$font-size-height}) / 2
5252
);
53-
inset-inline: #{variables.$db-spacing-fixed-sm};
53+
inset-inline: var(
54+
--db-form-component-padding-inline-start,
55+
#{variables.$db-spacing-fixed-sm}
56+
);
5457
}
5558

5659
// icons

showcases/shared/input.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,5 +372,105 @@
372372
}
373373
}
374374
]
375+
},
376+
{
377+
"name": "Example - Types - Floating Label",
378+
"examples": [
379+
{
380+
"name": "(Default) Text",
381+
"props": {
382+
"label": "Label",
383+
"labelVariant": "floating"
384+
}
385+
},
386+
{
387+
"name": "Password",
388+
"props": {
389+
"label": "Label",
390+
"type": "password",
391+
"labelVariant": "floating"
392+
}
393+
},
394+
{
395+
"name": "Search",
396+
"props": {
397+
"label": "Label",
398+
"type": "search",
399+
"labelVariant": "floating"
400+
}
401+
},
402+
{
403+
"name": "E-Mail",
404+
"props": {
405+
"label": "Label",
406+
"type": "email",
407+
"labelVariant": "floating"
408+
}
409+
},
410+
{
411+
"name": "Number",
412+
"props": {
413+
"label": "Label",
414+
"type": "number",
415+
"labelVariant": "floating"
416+
}
417+
},
418+
{
419+
"name": "Tel",
420+
"props": {
421+
"label": "Label",
422+
"type": "tel",
423+
"labelVariant": "floating"
424+
}
425+
},
426+
{
427+
"name": "URL",
428+
"props": {
429+
"label": "Label",
430+
"type": "url",
431+
"labelVariant": "floating"
432+
}
433+
},
434+
{
435+
"name": "Date",
436+
"props": {
437+
"label": "Label",
438+
"type": "date",
439+
"labelVariant": "floating"
440+
}
441+
},
442+
{
443+
"name": "Datetime Local",
444+
"props": {
445+
"label": "Label",
446+
"type": "datetime-local",
447+
"labelVariant": "floating"
448+
}
449+
},
450+
{
451+
"name": "Month",
452+
"props": {
453+
"label": "Label",
454+
"type": "month",
455+
"labelVariant": "floating"
456+
}
457+
},
458+
{
459+
"name": "Time",
460+
"props": {
461+
"label": "Label",
462+
"type": "time",
463+
"labelVariant": "floating"
464+
}
465+
},
466+
{
467+
"name": "Week",
468+
"props": {
469+
"label": "Label",
470+
"type": "week",
471+
"labelVariant": "floating"
472+
}
473+
}
474+
]
375475
}
376476
]

0 commit comments

Comments
 (0)