Skip to content

Commit

Permalink
Fix switching cause full-page scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Aug 20, 2024
1 parent 1a49e47 commit cebd13f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/configure/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en" class="overflow-hidden">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ type Props<T extends ValidComponent = "div"> = PolymorphicProps<
const Switch = <T extends ValidComponent = "div">(props: Props<T>) => {
const [local, rest] = splitProps(props as Props<"div">, [
"label",
"class",
"errorMessage",
]);
return (
<SwitchPrimitive.Root {...rest}>
<SwitchPrimitive.Root class={clsx("relative", props.class)} {...rest}>
<SwitchPrimitive.Input />
<div class="items-top flex space-x-2">
<SwitchPrimitive.Control class="bg-input focus-visible:ring-ring focus-visible:ring-offset-background data-[checked]:bg-primary peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50">
Expand Down

0 comments on commit cebd13f

Please sign in to comment.