update select dropDown
This commit is contained in:
@@ -31,6 +31,7 @@ export interface SelectProps {
|
|||||||
mode?: "single" | "multiple"; // multiple not implemented yet
|
mode?: "single" | "multiple"; // multiple not implemented yet
|
||||||
style?: StyleProp<ViewStyle>;
|
style?: StyleProp<ViewStyle>;
|
||||||
size?: "small" | "middle" | "large";
|
size?: "small" | "middle" | "large";
|
||||||
|
listStyle?: StyleProp<ViewStyle>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +51,7 @@ const Select: React.FC<SelectProps> = ({
|
|||||||
showSearch = false,
|
showSearch = false,
|
||||||
mode = "single",
|
mode = "single",
|
||||||
style,
|
style,
|
||||||
|
listStyle,
|
||||||
size = "middle",
|
size = "middle",
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedValue, setSelectedValue] = useState<
|
const [selectedValue, setSelectedValue] = useState<
|
||||||
@@ -152,7 +154,7 @@ const Select: React.FC<SelectProps> = ({
|
|||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ScrollView style={styles.list}>
|
<ScrollView style={[styles.list, listStyle]}>
|
||||||
{filteredOptions.map((item) => (
|
{filteredOptions.map((item) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.value}
|
key={item.value}
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
placeholder="Chọn đơn vị"
|
placeholder="Chọn đơn vị"
|
||||||
disabled={!isEditing}
|
disabled={!isEditing}
|
||||||
|
listStyle={{ maxHeight: 100 }}
|
||||||
/>
|
/>
|
||||||
{errors.fish?.[index]?.unit && (
|
{errors.fish?.[index]?.unit && (
|
||||||
<Text style={styles.errorText}>
|
<Text style={styles.errorText}>
|
||||||
|
|||||||
Reference in New Issue
Block a user