Skip to content

Commit

Permalink
feat(radio): raido group wraps by default (#2358)
Browse files Browse the repository at this point in the history
* feat(radio): raido group wraps by default

* test(radio): update snap

* refactor(radio): update _common

* test(snap): update snap
  • Loading branch information
ontheroad1992 authored Jul 11, 2023
1 parent 7d0109a commit 43d6b94
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 119 deletions.
9 changes: 7 additions & 2 deletions src/radio/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ const RadioGroup = (props: RadioGroupProps) => {
const checkedRadio = radioGroupRef.current.querySelector?.(checkedRadioCls) as HTMLElement;
if (!checkedRadio) return setBarStyle({ width: 0 });

const { offsetWidth, offsetLeft } = checkedRadio;
setBarStyle({ width: `${offsetWidth}px`, left: `${offsetLeft}px` });
const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = checkedRadio;
setBarStyle({
width: `${offsetWidth}px`,
height: `${offsetHeight}px`,
left: `${offsetLeft}px`,
top: `${offsetTop}px`,
});
};

useEffect(() => {
Expand Down
Loading

0 comments on commit 43d6b94

Please sign in to comment.