diff --git a/components/radio/radio.tsx b/components/radio/radio.tsx index eca3af6e0e..0a55df4e99 100644 --- a/components/radio/radio.tsx +++ b/components/radio/radio.tsx @@ -7,7 +7,7 @@ import RadioGroupContext from './context'; import { composeRef } from '../_util/ref'; import devWarning from '../_util/devWarning'; -const InternalRadio: React.ForwardRefRenderFunction = (props, ref) => { +const InternalRadio: React.ForwardRefRenderFunction = (props, ref) => { const context = React.useContext(RadioGroupContext); const { getPrefixCls, direction } = React.useContext(ConfigContext); const innerRef = React.useRef(); @@ -37,8 +37,8 @@ const InternalRadio: React.ForwardRefRenderFunction = (prop radioProps.disabled = props.disabled || context.disabled; } const wrapperClassString = classNames( + `${prefixCls}-wrapper`, { - [`${prefixCls}-wrapper`]: true, [`${prefixCls}-wrapper-checked`]: radioProps.checked, [`${prefixCls}-wrapper-disabled`]: radioProps.disabled, [`${prefixCls}-wrapper-rtl`]: direction === 'rtl', @@ -54,13 +54,14 @@ const InternalRadio: React.ForwardRefRenderFunction = (prop onMouseEnter={props.onMouseEnter} onMouseLeave={props.onMouseLeave} > - + {children !== undefined ? {children} : null} ); }; const Radio = React.forwardRef(InternalRadio); + Radio.displayName = 'Radio'; Radio.defaultProps = { diff --git a/components/radio/style/index.less b/components/radio/style/index.less index bebbcc6765..7a805b1776 100644 --- a/components/radio/style/index.less +++ b/components/radio/style/index.less @@ -185,6 +185,7 @@ span.@{radio-prefix-cls} + * { position: absolute; top: 0; left: 0; + z-index: -1; width: 100%; height: 100%; }