Skip to content
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
4 changes: 4 additions & 0 deletions source/_patterns/01-elements/input/_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ We're using the construct of `label` and `input` elements shown below (both thei
- "Generally, explicit labels are better supported by assistive technology." - compare to the [W3C spec](https://www.w3.org/WAI/tutorials/forms/labels/#associating-labels-implicitly), seems to be a [WCAG criteria](https://www.w3.org/TR/WCAG20-TECHS/H44.html) that for, too.
- We could easily control the styling depending on the `input` elements (pseudo-)states w/o the need for JavaScript

## Auto suggestions

You could easily integrate the possibility to provide auto suggestions to your input fields via the [`list`-attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#list) on the `input`-HTML-elements as well as adding the suggestions via the [`datalist`-HTML-element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist). Please follow up within the [Input - Auto Suggestions](/patterns/elements-input-input-auto-suggest/elements-input-input-auto-suggest.rendered.html) section.

## Autofill

For heavily supporting the user on autofilling form fields (not only, but especially on mobile browsing) with information even already available on their devices, you could use the `autocomplete` attribute, as described e.g. here <https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/>
Expand Down
6 changes: 6 additions & 0 deletions source/_patterns/01-elements/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

width: 100%;

&[list] {
&::-webkit-calendar-picker-indicator {
margin-right: -1rem;
}
}

&:not(:placeholder-shown) {
padding-bottom: 0;
padding-top: to-rem($pxValue: 16);
Expand Down
3 changes: 2 additions & 1 deletion source/_patterns/01-elements/input/input~auto-suggest.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Input - Auto suggestions
tags: [style-1.6]
---

You could easily integrate the possibility to provide auto suggestions to your input fields via the [`list`-attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#list) on the `input`-HTML-elements as well as adding the suggestions via the [`datalist`-HTML-element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist).