Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ const styles = StyleSheet.create({
| Name | Type | Default | Description |
| ------------ | ------ | --------- | ------------------------------------------- |
| label | string | undefined | The input floating label |
| labelStyle | any | undefined | The style applied to the input label Text |
| wrapperStyle | any | undefined | The style applied to the input wrapper View |
| textInputRef | ref | undefined | Ref to the input |

Expand Down
5 changes: 4 additions & 1 deletion src/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PropTypes from "prop-types";

export interface DialogInputProps extends TextInputProps {
label?: ReactNode;
labelStyle?: StyleProp;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure of proper value here

wrapperStyle?: StyleProp<ViewStyle>;
textInputRef?: LegacyRef<TextInput>;
}
Expand All @@ -25,6 +26,7 @@ const DialogInput: React.FC<DialogInputProps> = (props) => {
const {
label,
style,
labelStyle,
wrapperStyle,
textInputRef,
multiline,
Expand All @@ -37,7 +39,7 @@ const DialogInput: React.FC<DialogInputProps> = (props) => {
const { styles, isDark } = useTheme(buildStyles);
return (
<View style={[styles.textInputWrapper, wrapperStyle]}>
{label && <Text style={styles.label}>{label}</Text>}
{label && <Text style={[styles.label, labelStyle]}>{label}</Text>}
<TextInput
ref={textInputRef}
placeholderTextColor={
Expand Down Expand Up @@ -67,6 +69,7 @@ DialogInput.propTypes = {
...ViewPropTypes,
label: PropTypes.string,
textInputRef: PropTypes.any,
labelStyle: (Text as any).propTypes.style,
wrapperStyle: ViewPropTypes.style,
numberOfLines: PropTypes.number,
multiline: PropTypes.bool,
Expand Down