mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Hide caret during test runs
Summary: Changelog: [General][Changed] Hide caret in the TextInput during test runs. Reviewed By: lunaleaps Differential Revision: D26728766 fbshipit-source-id: b75827f00b4d5c6243d93106093f97b40dc4b366
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6ccd0cdebb
commit
397bfa6ad7
@@ -1083,6 +1083,13 @@ function InternalTextInput(props: Props): React.Node {
|
||||
],
|
||||
);
|
||||
|
||||
// Hide caret during test runs due to a flashing caret
|
||||
// makes screenshot tests flakey
|
||||
let caretHidden = props.caretHidden;
|
||||
if (Platform.isTesting) {
|
||||
caretHidden = true;
|
||||
}
|
||||
|
||||
// TextInput handles onBlur and onFocus events
|
||||
// so omitting onBlur and onFocus pressability handlers here.
|
||||
const {onBlur, onFocus, ...eventHandlers} = usePressability(config) || {};
|
||||
@@ -1105,6 +1112,7 @@ function InternalTextInput(props: Props): React.Node {
|
||||
{...eventHandlers}
|
||||
accessible={accessible}
|
||||
blurOnSubmit={blurOnSubmit}
|
||||
caretHidden={caretHidden}
|
||||
dataDetectorTypes={props.dataDetectorTypes}
|
||||
focusable={focusable}
|
||||
mostRecentEventCount={mostRecentEventCount}
|
||||
@@ -1143,6 +1151,7 @@ function InternalTextInput(props: Props): React.Node {
|
||||
accessible={accessible}
|
||||
autoCapitalize={autoCapitalize}
|
||||
blurOnSubmit={blurOnSubmit}
|
||||
caretHidden={caretHidden}
|
||||
children={children}
|
||||
disableFullscreenUI={props.disableFullscreenUI}
|
||||
focusable={focusable}
|
||||
|
||||
Reference in New Issue
Block a user