From e73c8a90ccb113881b2696319f9a198aa5721b58 Mon Sep 17 00:00:00 2001 From: wojciech-farmery <64034055+wojtek35@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:12:56 -0400 Subject: [PATCH] [OutlinedInput] Resolve border color issue on mobile (#43797) (#43879) --- .../src/OutlinedInput/OutlinedInput.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/mui-material/src/OutlinedInput/OutlinedInput.js b/packages/mui-material/src/OutlinedInput/OutlinedInput.js index e96b4ec567c638..af2715d017bda9 100644 --- a/packages/mui-material/src/OutlinedInput/OutlinedInput.js +++ b/packages/mui-material/src/OutlinedInput/OutlinedInput.js @@ -51,6 +51,14 @@ const OutlinedInputRoot = styled(InputBaseRoot, { [`&:hover .${outlinedInputClasses.notchedOutline}`]: { borderColor: (theme.vars || theme).palette.text.primary, }, + // Reset on touch devices, it doesn't add specificity + '@media (hover: none)': { + [`&:hover .${outlinedInputClasses.notchedOutline}`]: { + borderColor: theme.vars + ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` + : borderColor, + }, + }, [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: { borderWidth: 2, }, @@ -68,14 +76,6 @@ const OutlinedInputRoot = styled(InputBaseRoot, { { props: {}, // to overide the above style style: { - // Reset on touch devices, it doesn't add specificity - '@media (hover: none)': { - [`&:hover .${outlinedInputClasses.notchedOutline}`]: { - borderColor: theme.vars - ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` - : borderColor, - }, - }, [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: { borderColor: (theme.vars || theme).palette.error.main, },