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:
@@ -125,7 +125,7 @@
|
||||
@apply rotate-180;
|
||||
}
|
||||
|
||||
&[data-slot="hv-autocomplete-default-indicator"] {
|
||||
&[data-slot="autocomplete-default-indicator"] {
|
||||
@apply size-4;
|
||||
}
|
||||
}
|
||||
@@ -265,7 +265,7 @@
|
||||
@apply pointer-events-none opacity-0;
|
||||
}
|
||||
|
||||
[data-slot="hv-autocomplete-clear-button-icon"] {
|
||||
[data-slot="autocomplete-clear-button-icon"] {
|
||||
@apply size-3.5;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,12 +89,12 @@
|
||||
@apply cursor-not-allowed opacity-50;
|
||||
}
|
||||
|
||||
[data-slot="hv-combo-box-trigger-default-icon"] {
|
||||
[data-slot="combo-box-trigger-default-icon"] {
|
||||
@apply size-4 transition-transform duration-150 motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Rotate icon when trigger is open */
|
||||
&[data-open="true"] [data-slot="hv-combo-box-trigger-default-icon"] {
|
||||
&[data-open="true"] [data-slot="combo-box-trigger-default-icon"] {
|
||||
@apply rotate-180;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,11 +373,23 @@ export default defineComponent({
|
||||
|
||||
function confirmActive() {
|
||||
const key = activeKey.value;
|
||||
if (key === undefined) return;
|
||||
const record = records.value.find(
|
||||
(item) => item.key === key && filter(item) && !item.disabled,
|
||||
);
|
||||
if (!record) return;
|
||||
const record =
|
||||
key === undefined
|
||||
? undefined
|
||||
: records.value.find(
|
||||
(item) => item.key === key && filter(item) && !item.disabled,
|
||||
);
|
||||
if (key === undefined || !record) {
|
||||
const typed = inputValue.value.trim();
|
||||
// A custom value is the typed text itself, not a collection key.
|
||||
if (
|
||||
props.allowsCustomValue &&
|
||||
props.selectionMode === "single" &&
|
||||
typed
|
||||
)
|
||||
request([typed]);
|
||||
return;
|
||||
}
|
||||
if (props.selectionMode === "multiple") {
|
||||
// Confirming the active row toggles it inside the accepted set.
|
||||
const next = keys.value.includes(key)
|
||||
|
||||
Reference in New Issue
Block a user