mirror of https://github.com/twbs/bootstrap.git
				
				
				
			Document example of datalists with form controls (#29058)
- Add example to the new form control docs - Reset the [list] selector in Reboot to hide the random dropdown arrow in Chrome
This commit is contained in:
		
							parent
							
								
									1a9b1206c2
								
							
						
					
					
						commit
						b02bae769e
					
				| 
						 | 
					@ -407,6 +407,13 @@ select {
 | 
				
			||||||
  word-wrap: normal;
 | 
					  word-wrap: normal;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Remove the dropdown arrow in Chrome from inputs built with datalists.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Source: https://stackoverflow.com/a/54997118
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[list]::-webkit-calendar-picker-indicator {
 | 
				
			||||||
 | 
					  display: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 | 
					// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 | 
				
			||||||
//    controls in Android 4.
 | 
					//    controls in Android 4.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,3 +84,23 @@ Keep in mind color inputs are [not supported in IE](https://caniuse.com/#feat=in
 | 
				
			||||||
  <input type="color" class="form-control form-control-color" id="exampleColorInput" value="#563d7c" title="Choose your color">
 | 
					  <input type="color" class="form-control form-control-color" id="exampleColorInput" value="#563d7c" title="Choose your color">
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
{{< /example >}}
 | 
					{{< /example >}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Datalists
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Datalists allow you to create a group of `<option>`s that can be accessed (and autocompleted) from within an `<input>`. These are similar to `<select>` elements, but come with more menu styling limitations and differences. While most browsers and operating systems include some support for `<datalist>` elements, their styling is inconsistent at best.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Learn more about [support for datalist elements](https://caniuse.com/#feat=datalist).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{< example >}}
 | 
				
			||||||
 | 
					<form>
 | 
				
			||||||
 | 
					  <label for="exampleDataList">Datalist example</label>
 | 
				
			||||||
 | 
					  <input class="form-control" list="datalistOptions" id="exampleDataList" placeholder="Type to search...">
 | 
				
			||||||
 | 
					  <datalist id="datalistOptions">
 | 
				
			||||||
 | 
					    <option value="San Francisco">
 | 
				
			||||||
 | 
					    <option value="New York">
 | 
				
			||||||
 | 
					    <option value="Seattle">
 | 
				
			||||||
 | 
					    <option value="Los Angeles">
 | 
				
			||||||
 | 
					    <option value="Chicago">
 | 
				
			||||||
 | 
					  </datalist>
 | 
				
			||||||
 | 
					</form>
 | 
				
			||||||
 | 
					{{< /example >}}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue