mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-31 01:36:11 +00:00
[fix] Text automatic writing direction detection
This commit is contained in:
@@ -18,7 +18,8 @@ rn-paddingBottom:0px
|
|||||||
rn-paddingLeft:0px
|
rn-paddingLeft:0px
|
||||||
rn-textDecoration:none
|
rn-textDecoration:none
|
||||||
rn-whiteSpace:pre-wrap
|
rn-whiteSpace:pre-wrap
|
||||||
rn-wordWrap:break-word">
|
rn-wordWrap:break-word"
|
||||||
|
dir="auto">
|
||||||
children
|
children
|
||||||
</span>
|
</span>
|
||||||
`;
|
`;
|
||||||
@@ -45,6 +46,7 @@ rn-paddingLeft:0px
|
|||||||
rn-textDecoration:none
|
rn-textDecoration:none
|
||||||
rn-whiteSpace:pre-wrap
|
rn-whiteSpace:pre-wrap
|
||||||
rn-wordWrap:break-word"
|
rn-wordWrap:break-word"
|
||||||
|
dir="auto"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
onKeyDown={[Function]}
|
onKeyDown={[Function]}
|
||||||
style={Object {}}
|
style={Object {}}
|
||||||
@@ -71,7 +73,8 @@ rn-paddingBottom:0px
|
|||||||
rn-paddingLeft:0px
|
rn-paddingLeft:0px
|
||||||
rn-textDecoration:none
|
rn-textDecoration:none
|
||||||
rn-whiteSpace:pre-wrap
|
rn-whiteSpace:pre-wrap
|
||||||
rn-wordWrap:break-word" />
|
rn-wordWrap:break-word"
|
||||||
|
dir="auto" />
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`components/Text prop "selectable" 2`] = `
|
exports[`components/Text prop "selectable" 2`] = `
|
||||||
@@ -96,5 +99,6 @@ rn-textDecoration:none
|
|||||||
rn-userSelect:none
|
rn-userSelect:none
|
||||||
rn-whiteSpace:pre-wrap
|
rn-whiteSpace:pre-wrap
|
||||||
rn-wordWrap:break-word"
|
rn-wordWrap:break-word"
|
||||||
|
dir="auto"
|
||||||
style={Object {}} />
|
style={Object {}} />
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ class Text extends Component {
|
|||||||
numberOfLines === 1 && styles.singleLineStyle,
|
numberOfLines === 1 && styles.singleLineStyle,
|
||||||
onPress && styles.pressable
|
onPress && styles.pressable
|
||||||
];
|
];
|
||||||
|
// allow browsers to automatically infer the language writing direction
|
||||||
|
otherProps.dir = 'auto';
|
||||||
|
|
||||||
return createDOMElement('span', otherProps);
|
return createDOMElement('span', otherProps);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user