Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/RightButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const RightButton = memo(
loading,
buttonsContainerStyle,
ChevronIconComponent,
ClearIconComponent
ClearIconComponent,
RightIconComponent,
onSubmit,
}) => {
const isOpenedAnimationValue = useRef(new Animated.Value(0)).current

Expand Down Expand Up @@ -46,6 +48,9 @@ export const RightButton = memo(
</TouchableOpacity>
)}
{loading && <ActivityIndicator color="#999" />}
{RightIconComponent && <TouchableOpacity onPress={onSubmit} style={styles.chevronButton}>
{RightIconComponent}
</TouchableOpacity>}
{showChevron && (
<Animated.View style={{ transform: [{ rotate: chevronSpin }] }}>
<TouchableOpacity onPress={onChevronPress} style={styles.chevronButton}>
Expand Down
11 changes: 9 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import React, { FC } from 'react';
import { StyleProp, TextInputProps, TextStyle, ViewStyle, FlatListProps } from 'react-native';
import React, { FC } from "react";
import {
StyleProp,
TextInputProps,
TextStyle,
ViewStyle,
FlatListProps,
} from "react-native";

export type TAutocompleteDropdownItem = {
id: string;
Expand Down Expand Up @@ -58,6 +64,7 @@ interface AutocompleteDropdownProps {
suggestionsListContainerStyle?: StyleProp<ViewStyle>;
suggestionsListTextStyle?: StyleProp<TextStyle>;
ChevronIconComponent?: JSX.Element;
RightIconComponent?: JSX.Element;
ClearIconComponent?: JSX.Element;
InputComponent?: React.ComponentType;
ItemSeparatorComponent?: JSX.Element;
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ export const AutocompleteDropdown = memo(
buttonsContainerStyle={props.rightButtonsContainerStyle}
ChevronIconComponent={props.ChevronIconComponent}
ClearIconComponent={props.ClearIconComponent}
RightIconComponent={props.RightIconComponent}
onSubmit={onSubmit}
/>
</View>
{isOpened && Array.isArray(dataSet) && (
Expand Down Expand Up @@ -349,6 +351,7 @@ AutocompleteDropdown.propTypes = {
suggestionsListContainerStyle: PropTypes.object,
suggestionsListTextStyle: PropTypes.object,
ChevronIconComponent: PropTypes.element,
RightIconComponent: PropTypes.element,
ClearIconComponent: PropTypes.element,
ScrollViewComponent: PropTypes.elementType,
EmptyResultComponent: PropTypes.element,
Expand Down