Skip to content

Commit c6d30e4

Browse files
authored
Fix/ TextField for react-native-web (#2374)
* fix TextField for react-native-web * add Constants.isWeb
1 parent 19ee086 commit c6d30e4

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/commons/Constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export enum orientations {
88

99
const isAndroid: boolean = Platform.OS === 'android';
1010
const isIOS: boolean = Platform.OS === 'ios';
11+
const isWeb: boolean = Platform.OS === 'web';
1112
let isTablet: boolean;
1213
let statusBarHeight: number;
1314
let screenHeight: number = Dimensions.get('screen').height;
@@ -68,6 +69,7 @@ const constants = {
6869
orientations,
6970
isAndroid,
7071
isIOS,
72+
isWeb,
7173
getAndroidVersion: () => {
7274
return isAndroid ? parseInt(Platform.Version as string, 10) : undefined;
7375
},

src/incubator/TextField/FloatingPlaceholder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const FloatingPlaceholder = (props: FloatingPlaceholderProps) => {
7171
}, []);
7272

7373
return (
74-
<View absF style={hidePlaceholder && styles.hidden}>
74+
<View absF style={hidePlaceholder && styles.hidden} pointerEvents={'none'}>
7575
<Text
7676
animated
7777
color={getColorByState(floatingPlaceholderColor, context)}

src/incubator/TextField/Input.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const styles = StyleSheet.create({
5858
input: {
5959
flexGrow: 1,
6060
textAlign: Constants.isRTL ? 'right' : 'left',
61+
outlineWidth: Constants.isWeb ? 0 : undefined,
6162
// Setting paddingTop/Bottom separately fix height issues on iOS with multiline
6263
paddingTop: 0,
6364
paddingBottom: 0,

0 commit comments

Comments
 (0)