From b56761373b7f9327f129c917ee67cd361cb6afbd Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Thu, 26 Sep 2024 16:57:34 -0400 Subject: [PATCH] prettier --- docs/docs/components/select.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/docs/components/select.md b/docs/docs/components/select.md index f8318bdbe..7067816ad 100644 --- a/docs/docs/components/select.md +++ b/docs/docs/components/select.md @@ -307,11 +307,13 @@ Lazy loading options is very hard to get right. `` largely follows ho Here are the following conditions: -- If a `` is created without any options, but is given a `value` attribute, its `value` will be `""`, and then when options are added, if any of the options have a value equal to the `` value, the value of the `` will be that of the option. +- If a `` is created without any options, but is given a `value` attribute, its `value` will be `""`, and then when options are added, if any of the options have a value equal to the `` value, the value of the `` will equal that of the option. -- If a `` with an initial value has multiple values, but only some of the options are present, it will only respect the loaded options, and if a selected option is loaded in later, *AND* the value of the select has not changed via user interaction, it will add the selected option. +EX: `` will have a value of `""` until `Foo` connects, at which point its value will become `"foo"` when submitting. -This can be hard to conceptualize, so heres a fairly large example showing how lazy loaded options work with `` +- If a `` with an initial value has multiple values, but only some of the options are present, it will only respect the options that are present, and if a selected option is loaded in later, *AND* the value of the select has not changed via user interaction or direct property assignment, it will add the selected option to the form value and to the `.value` of the select. + +This can be hard to conceptualize, so heres a fairly large example showing how lazy loaded options work with `` and `` when given initial value attributes. Feel free to play around with it in a codepen. ```html {.example}
@@ -401,4 +403,4 @@ This can be hard to conceptualize, so heres a fairly large example showing how l container.addEventListener("click", addFooOption) container.addEventListener("submit", handleLazySubmit) -``` +``` \ No newline at end of file