From 3dee3b96e1978e20b927a7e190d6f248ecbd8e39 Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Thu, 1 Feb 2024 11:34:33 -0800 Subject: [PATCH] docs(value): add programmatic value example #152 --- apiExamples/programmaticValue.html | 12 +++++ demo/api.md | 83 ++++++++++++++++++++++-------- docs/partials/api.md | 33 +++++++++--- 3 files changed, 99 insertions(+), 29 deletions(-) create mode 100644 apiExamples/programmaticValue.html diff --git a/apiExamples/programmaticValue.html b/apiExamples/programmaticValue.html new file mode 100644 index 0000000..4836334 --- /dev/null +++ b/apiExamples/programmaticValue.html @@ -0,0 +1,12 @@ + + Name + + Apples + Oranges + Peaches + Grapes + Cherries + Prefer Alaska + No matching option + + diff --git a/demo/api.md b/demo/api.md index 327ab23..f34fb44 100644 --- a/demo/api.md +++ b/demo/api.md @@ -46,24 +46,22 @@ ### Basic -
-
-
- - - - Name - - Apples - Oranges - Peaches - Grapes - Cherries - No matching option - - - -
+
+ + + + Name + + Apples + Oranges + Peaches + Grapes + Cherries + No matching option + + + +
See code @@ -85,7 +83,7 @@ -#### Dynamic Menu +### Dynamic Menu This example demonstrates a data driven combobox. The data is used to populate the `auro-menu`. In this example, each time the input's value changes, the data is updated and the menu is recreated. @@ -406,7 +404,50 @@ Populates the `required` attribute on the input. Used for client-side validation #### value -Value selected for the dropdown menu. +Use the `value` attribute to programmatically set the value of the combobox. + +
+ + + + Name + + Apples + Oranges + Peaches + Grapes + Cherries + Prefer Alaska + No matching option + + + +
+ + See code + + + +```html + + Name + + Apples + Oranges + Peaches + Grapes + Cherries + Prefer Alaska + No matching option + + +``` + + + +#### Dynamically Set Value + +Use the `value` attribute in combination with another element to dynamically set the value of the combobox. Can be used in the following ways: * Preset the value of the combobox to valid menu option @@ -435,7 +476,7 @@ Note: using a value that does not match a menu option will reset the combobox va -
+
See code diff --git a/docs/partials/api.md b/docs/partials/api.md index ba30976..6301c9f 100644 --- a/docs/partials/api.md +++ b/docs/partials/api.md @@ -6,12 +6,11 @@ ### Basic -
-
-
- - -
+
+ + +
+ See code @@ -20,7 +19,7 @@ -#### Dynamic Menu +### Dynamic Menu This example demonstrates a data driven combobox. The data is used to populate the `auro-menu`. In this example, each time the input's value changes, the data is updated and the menu is recreated. @@ -126,7 +125,24 @@ Populates the `required` attribute on the input. Used for client-side validation #### value -Value selected for the dropdown menu. +Use the `value` attribute to programmatically set the value of the combobox. + +
+ + +
+ + + See code + + + + + + +#### Dynamically Set Value + +Use the `value` attribute in combination with another element to dynamically set the value of the combobox. Can be used in the following ways: * Preset the value of the combobox to valid menu option @@ -139,6 +155,7 @@ Note: using a value that does not match a menu option will reset the combobox va
+ See code