diff --git a/demos/select.html b/demos/select.html
index c4d43b30a92..2608f0e5865 100644
--- a/demos/select.html
+++ b/demos/select.html
@@ -131,6 +131,7 @@
Fully-Featured JS Component
+
Select box
@@ -178,6 +179,67 @@ Select box
+
+
+ Outlined Select
+
+
+
+
+
+
+
+
+ Currently selected: (none)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Pre-selected option via HTML
@@ -307,6 +369,49 @@ MDC Select with optgroups
updateSelectedTextContent();
});
});
+
+ demoReady(function() {
+
+ var root = document.getElementById('outline-js-select');
+ var currentlySelected = document.getElementById('currently-selected-outline');
+ var select = new mdc.select.MDCSelect(root);
+ var demoWrapper = root.parentElement;
+ var rtlCb = document.getElementById('rtl-outline');
+ var alternateColorsCb = document.getElementById('alternate-colors-outline');
+ var disabledCb = document.getElementById('disabled-outline');
+ var setSelectedButton = document.getElementById('set-selected-index-zero-button-outline');
+ var setValueMeatButton = document.getElementById('set-value-meat-button-outline');
+ function updateSelectedTextContent() {
+ var value = select.value;
+ var index = select.selectedIndex;
+ currentlySelected.textContent = value ? value + ' at index ' + index : '(none)';
+ }
+ root.addEventListener('change', function() {
+ updateSelectedTextContent();
+ });
+ rtlCb.addEventListener('change', function() {
+ if (rtlCb.checked) {
+ demoWrapper.setAttribute('dir', 'rtl');
+ } else {
+ demoWrapper.removeAttribute('dir');
+ }
+ select.layout();
+ });
+ alternateColorsCb.addEventListener('change', function() {
+ root.classList[alternateColorsCb.checked ? 'add' : 'remove']('demo-select-custom-colors');
+ });
+ disabledCb.addEventListener('change', function() {
+ select.disabled = disabledCb.checked;
+ });
+ setSelectedButton.addEventListener('click', function() {
+ select.selectedIndex = 0;
+ updateSelectedTextContent();
+ });
+ setValueMeatButton.addEventListener('click', function() {
+ select.value = 'meat';
+ updateSelectedTextContent();
+ });
+ });