Skip to content

Commit

Permalink
fix(switch): element type (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev authored Nov 10, 2023
1 parent aab1dbf commit 467383b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-bikes-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/switch": patch
---

Fix switch base element type it is an input now.
2 changes: 1 addition & 1 deletion packages/components/switch/src/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {UseSwitchProps, useSwitch} from "./use-switch";

export interface SwitchProps extends UseSwitchProps {}

const Switch = forwardRef<"label", SwitchProps>((props, ref) => {
const Switch = forwardRef<"input", SwitchProps>((props, ref) => {
const {
Component,
children,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/switch/src/use-switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type SwitchThumbIconProps = {
isSelected: boolean;
className: string;
};
interface Props extends HTMLNextUIProps<"label"> {
interface Props extends HTMLNextUIProps<"input"> {
/**
* Ref to the DOM node.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/switch/stories/switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const DisableAnimation = {
},
};

export const WiththumbIcon = {
export const WithThumbIcon = {
args: {
...defaultProps,
size: "xl",
Expand Down

2 comments on commit 467383b

@vercel
Copy link

@vercel vercel bot commented on 467383b Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 467383b Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.