Skip to content

Commit 287251a

Browse files
committed
[change] Remove 'placeholderTextColor' from 'createElement' props
TextInput converts the 'placeholderTextColor' prop to a style.
1 parent e670e81 commit 287251a

File tree

2 files changed

+7
-6
lines changed
  • packages/react-native-web/src

2 files changed

+7
-6
lines changed

packages/react-native-web/src/exports/TextInput/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import css from '../StyleSheet/css';
1818
import filterSupportedProps from '../View/filterSupportedProps';
1919
import findNodeHandle from '../findNodeHandle';
2020
import React from 'react';
21+
import StyleSheet from '../StyleSheet';
2122
import TextInputState from '../../modules/TextInputState';
2223

2324
const isAndroid = canUseDOM && /Android/i.test(navigator && navigator.userAgent);
@@ -111,6 +112,7 @@ class TextInput extends React.Component<TextInputProps> {
111112
returnKeyType,
112113
secureTextEntry = false,
113114
spellCheck,
115+
style,
114116
value
115117
} = this.props;
116118

@@ -163,10 +165,13 @@ class TextInput extends React.Component<TextInputProps> {
163165
onKeyPress: this._handleKeyPress,
164166
onSelect: normalizeEventHandler(this._handleSelectionChange),
165167
placeholder,
166-
placeholderTextColor,
167168
readOnly: !editable,
168169
ref: this._setNode,
169170
spellCheck: spellCheck != null ? spellCheck : autoCorrect,
171+
style: StyleSheet.compose(
172+
style,
173+
placeholderTextColor && { placeholderTextColor }
174+
),
170175
value
171176
});
172177

packages/react-native-web/src/modules/createDOMProps/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ const createDOMProps = (component, props, styleResolver) => {
7070
disabled: providedDisabled,
7171
importantForAccessibility,
7272
nativeID,
73-
placeholderTextColor,
7473
pointerEvents,
7574
style: providedStyle,
7675
testID,
@@ -171,10 +170,7 @@ const createDOMProps = (component, props, styleResolver) => {
171170
// STYLE
172171
const reactNativeStyle = StyleSheet.compose(
173172
pointerEvents && pointerEventsStyles[pointerEvents],
174-
StyleSheet.compose(
175-
providedStyle,
176-
placeholderTextColor && { placeholderTextColor }
177-
)
173+
providedStyle
178174
);
179175

180176
// Additional style resets for interactive elements

0 commit comments

Comments
 (0)