Skip to content

Commit

Permalink
Merge pull request Expensify#24525 from dukenv0307/fix/23003
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl authored Aug 17, 2023
2 parents 6e055d0 + 72e8f05 commit 0bdf183
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ function BaseTextInput(props) {
// We can't use inputValue here directly, as it might contain
// the defaultValue, which doesn't get updated when the text changes.
// We can't use props.value either, as it might be undefined.
if (hasValueRef.current || isFocused) {
if (hasValueRef.current || isFocused || isInputAutoFilled(input.current)) {
activateLabel();
} else if (!hasValueRef.current && !isFocused) {
} else {
deactivateLabel();
}
}, [activateLabel, deactivateLabel, inputValue, isFocused]);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/isInputAutoFilled.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import isSelectorSupported from './isSelectorSupported';
* @return {Boolean}
*/
export default function isInputAutoFilled(input) {
if (!input.matches) return false;
if (!input || !input.matches) return false;
if (isSelectorSupported(':autofill')) {
return input.matches(':-webkit-autofill') || input.matches(':autofill');
}
Expand Down

0 comments on commit 0bdf183

Please sign in to comment.