mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
add gap between input and items in VirtualMultiSelect
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: var(--theme-spacing-sm);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,9 +21,6 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
|
||||||
border-bottom: 1px solid var(--theme-colors-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-option {
|
.selected-option {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import clsx from 'clsx';
|
||||||
import { useOverlayScrollbars } from 'overlayscrollbars-react';
|
import { useOverlayScrollbars } from 'overlayscrollbars-react';
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -195,9 +196,12 @@ export function VirtualMultiSelect<T>({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${styles.container} ${disabled ? styles.disabled : ''}`}>
|
<div
|
||||||
|
className={clsx(styles.container, {
|
||||||
|
[styles.disabled]: disabled,
|
||||||
|
})}
|
||||||
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
className={styles['search-input']}
|
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
label={labelWithClear}
|
label={labelWithClear}
|
||||||
leftSection={
|
leftSection={
|
||||||
@@ -244,7 +248,7 @@ export function VirtualMultiSelect<T>({
|
|||||||
value={search}
|
value={search}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={styles['list-container']}
|
className={styles.listContainer}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
onMouseDown={(e) => {
|
onMouseDown={(e) => {
|
||||||
if (disabled) return;
|
if (disabled) return;
|
||||||
@@ -288,7 +292,9 @@ export function VirtualMultiSelect<T>({
|
|||||||
<Stack gap="xs" mt="sm">
|
<Stack gap="xs" mt="sm">
|
||||||
{selectedOptions.map((option) => (
|
{selectedOptions.map((option) => (
|
||||||
<Group
|
<Group
|
||||||
className={`${styles['selected-option']} ${disabled ? styles.disabled : ''}`}
|
className={clsx(styles.selectedOption, {
|
||||||
|
[styles.disabled]: disabled,
|
||||||
|
})}
|
||||||
gap="sm"
|
gap="sm"
|
||||||
key={option.value}
|
key={option.value}
|
||||||
onClick={() => handleDeselect(option.value)}
|
onClick={() => handleDeselect(option.value)}
|
||||||
|
|||||||
Reference in New Issue
Block a user