Skip to content

Commit

Permalink
fix: Flatten styles
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed Sep 8, 2022
1 parent 5a9e6ee commit 844522d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type {
PressEvent,
} from '../../Types/CoreEventTypes';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import flattenStyle from '../../StyleSheet/flattenStyle';

const {useLayoutEffect, useRef, useState} = React;

Expand Down Expand Up @@ -1490,13 +1491,12 @@ const ExportedForwardRef: React.AbstractComponent<
React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
>,
) {
let style = restProps.style;
let style = flattenStyle(restProps.style);

if (style && style.verticalAlign !== undefined) {
style = StyleSheet.compose(style, {
textAlignVertical:
// $FlowFixMe
verticalAlignToTextAlignVerticalMap[style.verticalAlign],
});
// $FlowFixMe
style.textAlignVertical =
verticalAlignToTextAlignVerticalMap[style.verticalAlign];
}

return (
Expand Down
1 change: 1 addition & 0 deletions Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const Text: React.AbstractComponent<
}

if (style && style.verticalAlign !== undefined) {
// $FlowFixMe[prop-missing]
style = StyleSheet.compose(style, {
textAlignVertical:
verticalAlignToTextAlignVerticalMap[style.verticalAlign],
Expand Down

0 comments on commit 844522d

Please sign in to comment.