feat(combobox): improve style and menu trigger mode
This commit is contained in:
parent
634d78e369
commit
65dffd0e19
1 changed files with 8 additions and 3 deletions
|
@ -48,7 +48,6 @@ export function ComboBox({
|
||||||
<AriaComboBox
|
<AriaComboBox
|
||||||
{...props}
|
{...props}
|
||||||
className={`fr-ds-combobox ${className ?? ''}`}
|
className={`fr-ds-combobox ${className ?? ''}`}
|
||||||
menuTrigger="focus"
|
|
||||||
shouldFocusWrap={true}
|
shouldFocusWrap={true}
|
||||||
>
|
>
|
||||||
{label ? <Label className="fr-label">{label}</Label> : null}
|
{label ? <Label className="fr-label">{label}</Label> : null}
|
||||||
|
@ -114,7 +113,12 @@ export function SingleComboBox({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ComboBox aria-labelledby={labelledby} {...comboBoxProps} {...props}>
|
<ComboBox
|
||||||
|
aria-labelledby={labelledby}
|
||||||
|
menuTrigger="focus"
|
||||||
|
{...comboBoxProps}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{(item) => <ComboBoxItem id={item.value}>{item.label}</ComboBoxItem>}
|
{(item) => <ComboBoxItem id={item.value}>{item.label}</ComboBoxItem>}
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
{children || name ? (
|
{children || name ? (
|
||||||
|
@ -184,7 +188,7 @@ export function MultiComboBox(maybeProps: MultiComboBoxProps) {
|
||||||
key={item.value}
|
key={item.value}
|
||||||
id={item.value}
|
id={item.value}
|
||||||
textValue={`Retirer ${item.label}`}
|
textValue={`Retirer ${item.label}`}
|
||||||
className="fr-tag fr-tag--sm"
|
className="fr-tag fr-tag--sm fr-tag--dismiss"
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
<Button slot="remove" className="fr-tag--dismiss"></Button>
|
<Button slot="remove" className="fr-tag--dismiss"></Button>
|
||||||
|
@ -197,6 +201,7 @@ export function MultiComboBox(maybeProps: MultiComboBoxProps) {
|
||||||
aria-labelledby={labelledby}
|
aria-labelledby={labelledby}
|
||||||
allowsCustomValue={allowsCustomValue}
|
allowsCustomValue={allowsCustomValue}
|
||||||
inputRef={inputRef}
|
inputRef={inputRef}
|
||||||
|
menuTrigger="focus"
|
||||||
{...comboBoxProps}
|
{...comboBoxProps}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue