22 <div :class =" n('wrap')" >
33 <div
44 ref =" action"
5+ v-hover:desktop =" handleHovering"
56 role =" radio"
67 :tabindex =" tabIndex"
78 :aria-checked =" checked"
1314 @blur =" isFocusing = false"
1415 >
1516 <div
17+ ref =" circleRef"
1618 v-ripple =" { disabled: formReadonly || readonly || formDisabled || disabled || !ripple }"
17- v-hover:desktop =" handleHovering"
1819 :class ="
1920 classes(
2021 n('action'),
@@ -64,7 +65,7 @@ import { useForm } from '../form/provide'
6465import Hover from ' ../hover'
6566import VarHoverOverlay , { useHoverOverlay } from ' ../hover-overlay'
6667import VarIcon from ' ../icon'
67- import Ripple from ' ../ripple'
68+ import Ripple , { RippleHTMLElement } from ' ../ripple'
6869import { createNamespace , useValidation } from ' ../utils/components'
6970import { props , type RadioValidateTrigger } from ' ./props'
7071import { useRadioGroup , type RadioProvider } from ' ./provide'
@@ -83,6 +84,7 @@ export default defineComponent({
8384 props ,
8485 setup(props ) {
8586 const action = ref <HTMLElement >()
87+ const circleRef = ref <RippleHTMLElement >()
8688 const isFocusing = ref (false )
8789 const value = useVModel (props , ' modelValue' )
8890 const checked = computed (() => value .value === props .checkedValue )
@@ -200,6 +202,19 @@ export default defineComponent({
200202 }
201203
202204 function handleTextClick() {
205+ // Manually trigger the ripple effect on text click
206+ if (circleRef .value ) {
207+ if (circleRef .value ?._ripple && typeof circleRef .value ?._ripple ?.removeRipple === ' function' ) {
208+ // Remove any existing ripple
209+ circleRef .value ._ripple ?.removeRipple ()
210+ }
211+
212+ if (circleRef .value ?._ripple && typeof circleRef .value ?.dispatchEvent === ' function' ) {
213+ // Create a fake keyboard event to trigger the ripple
214+ const event = new Event (' touchstart' )
215+ circleRef .value .dispatchEvent (event )
216+ }
217+ }
203218 action .value ! .focus ()
204219 }
205220
@@ -236,6 +251,7 @@ export default defineComponent({
236251
237252 return {
238253 action ,
254+ circleRef ,
239255 isFocusing ,
240256 checked ,
241257 errorMessage ,
0 commit comments