Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: patch for text input label #2678

Merged
merged 1 commit into from
Apr 23, 2021
Merged
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
4 changes: 3 additions & 1 deletion src/components/TextInput/Label/LabelBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { Animated, StyleSheet } from 'react-native';

import AnimatedText from '../../Typography/AnimatedText';
import { useTheme } from '../../../core/theming';

import type { LabelBackgroundProps } from '../types';

Expand All @@ -22,6 +23,7 @@ const LabelBackground = ({
inputRange: [0, 1],
outputRange: [hasFocus ? 1 : 0, 0],
});
const { roundness } = useTheme();

const labelTranslationX = {
transform: [
Expand All @@ -45,6 +47,7 @@ const LabelBackground = ({
{
backgroundColor,
opacity,
bottom: Math.max(roundness, 2),
},
labelTranslationX,
]}
Expand Down Expand Up @@ -86,7 +89,6 @@ const styles = StyleSheet.create({
top: 6,
left: 10,
width: 8,
bottom: 2,
},
outlinedLabel: {
position: 'absolute',
Expand Down