From a5a298723c2993fd4fce149fa01dfe24dc18fe36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=97=E5=98=89=E7=94=B7?= <574980606@qq.com> Date: Sun, 17 Sep 2023 19:16:05 +0800 Subject: [PATCH] [Button] remove the ripple root element when ripple not active --- packages/mui-material-next/src/ButtonBase/TouchRipple.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/mui-material-next/src/ButtonBase/TouchRipple.tsx b/packages/mui-material-next/src/ButtonBase/TouchRipple.tsx index f223f6b9796280..a5fe3589caed9f 100644 --- a/packages/mui-material-next/src/ButtonBase/TouchRipple.tsx +++ b/packages/mui-material-next/src/ButtonBase/TouchRipple.tsx @@ -265,6 +265,10 @@ const TouchRipple = React.forwardRef(funct [start, stop], ); + if (ripples.length === 0) { + return null; + } + return (