fix(pickers): repair data-slot selectors and align demos with the baseline
The CSS port prefixed data-slot attribute values with hv-, so the compiled selectors never matched the DOM and the ComboBox trigger chevron never rotated. Only class names get the prefix; slot values stay byte-identical. Also commit typed text as the value when allowsCustomValue finds no record, restore the baseline search-field shell in all 24 Autocomplete demos, and correct both doc pages against the pinned upstream sources.
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
ListBoxItem,
|
||||
ListBoxItemIndicator,
|
||||
SearchField,
|
||||
SearchFieldClearButton,
|
||||
SearchFieldGroup,
|
||||
SearchFieldInput,
|
||||
SearchFieldSearchIcon,
|
||||
@@ -45,7 +46,8 @@ const message = ref<string | null>(null);
|
||||
function onSubmit(event: Event) {
|
||||
event.preventDefault();
|
||||
const formData = new FormData(event.currentTarget as HTMLFormElement);
|
||||
message.value = `表单提交成功!州:${formData.get("state")},国家:${formData.get("country")}`;
|
||||
void formData;
|
||||
message.value = "表单提交成功!";
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -66,10 +68,16 @@ function onSubmit(event: Event) {
|
||||
</AutocompleteTrigger>
|
||||
<AutocompletePopover>
|
||||
<AutocompleteFilter>
|
||||
<SearchField aria-label="搜索州名">
|
||||
<SearchField
|
||||
auto-focus
|
||||
name="search"
|
||||
variant="secondary"
|
||||
aria-label="搜索州名"
|
||||
>
|
||||
<SearchFieldGroup>
|
||||
<SearchFieldSearchIcon />
|
||||
<SearchFieldInput placeholder="搜索州名…" />
|
||||
<SearchFieldClearButton />
|
||||
</SearchFieldGroup>
|
||||
</SearchField>
|
||||
<ListBox>
|
||||
@@ -83,7 +91,7 @@ function onSubmit(event: Event) {
|
||||
<ListBoxItemIndicator />
|
||||
</ListBoxItem>
|
||||
<template #empty>
|
||||
<EmptyState class="p-1">未找到结果</EmptyState>
|
||||
<EmptyState>未找到结果</EmptyState>
|
||||
</template>
|
||||
</ListBox>
|
||||
</AutocompleteFilter>
|
||||
@@ -105,10 +113,16 @@ function onSubmit(event: Event) {
|
||||
</AutocompleteTrigger>
|
||||
<AutocompletePopover>
|
||||
<AutocompleteFilter>
|
||||
<SearchField aria-label="搜索国家">
|
||||
<SearchField
|
||||
auto-focus
|
||||
name="search"
|
||||
variant="secondary"
|
||||
aria-label="搜索国家"
|
||||
>
|
||||
<SearchFieldGroup>
|
||||
<SearchFieldSearchIcon />
|
||||
<SearchFieldInput placeholder="搜索国家…" />
|
||||
<SearchFieldClearButton />
|
||||
</SearchFieldGroup>
|
||||
</SearchField>
|
||||
<ListBox>
|
||||
@@ -122,7 +136,7 @@ function onSubmit(event: Event) {
|
||||
<ListBoxItemIndicator />
|
||||
</ListBoxItem>
|
||||
<template #empty>
|
||||
<EmptyState class="p-1">未找到结果</EmptyState>
|
||||
<EmptyState>未找到结果</EmptyState>
|
||||
</template>
|
||||
</ListBox>
|
||||
</AutocompleteFilter>
|
||||
@@ -130,7 +144,7 @@ function onSubmit(event: Event) {
|
||||
<FieldError />
|
||||
</Autocomplete>
|
||||
<Button type="submit">提交</Button>
|
||||
<p v-if="message" role="status" class="text-sm text-success">
|
||||
<p v-if="message" role="status" class="text-sm text-muted">
|
||||
{{ message }}
|
||||
</p>
|
||||
</Form>
|
||||
|
||||
Reference in New Issue
Block a user