-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - React does not recognize the isSelected
prop on a DOM element. CheckBox
#2860
Comments
This is because those props will be passed to type CheckboxIconProps = Partial<ReturnType<UseCheckboxReturn["getIconProps"]>>;
function CheckIcon(props: CheckboxIconProps) {
const {isSelected, disableAnimation, ...otherProps} = props;
return (
<svg aria-hidden="true" role="presentation" viewBox="0 0 17 18" {...otherProps}>
<polyline
fill="none"
points="1 9 7 14 15 4"
stroke="currentColor"
strokeDasharray={22}
strokeDashoffset={isSelected ? 44 : 66}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
style={
!disableAnimation && isSelected
? {
transition: "stroke-dashoffset 250ms linear 0.2s",
}
: {}
}
/>
</svg>
);
} You can also you custom icon function to avoid passing the props. icon: () => <div />, |
Hi, I have the same problem with My code: <Select
selectedKeys={[dynamicLocale]}
onChange={(e) => {
const locale = e.target.value as Locale | undefined
if (!locale) return
handleLocaleChange(locale)
setDynamicLocale(locale)
}}
className="w-[150px]"
aria-label={localesDetailed[lang].nativeName}
startContent={<Avatar alt={lang} className="!size-4 shrink-0" src={localesDetailed[lang].flag} />}
size="sm"
selectionMode="single"
>
{Object.entries(localesDetailed).map(([locale, details]) => (
<SelectItem
key={locale}
value={locale}
startContent={<Avatar alt={locale} className="!size-6" src={details.flag} />}
>
{details.nativeName}
</SelectItem>
))}
</Select> Thanks |
HI guys, I have started seeing this issue ( I assume it appeared with the |
Hey @wingkwong, here is a quick update on my side. I started seeing the error again. My version is
Here is an example snippet but i observed the error in any <Card>
<CardHeader>
<Badge>
<Avatar/>
<Badge/>
<CardHeader/>
...
<Card/> |
@bllakcn for avatar, it's a known issue on 2.4.2. See #3257 (comment). |
Closing - for original issue (checkbox), see this comment |
NextUI Version
2.3.5
Describe the bug
Your Example Website or App
https://codesandbox.io/p/sandbox/blissful-river-72wv8k?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clummlcvv00063j6kcic6i7lh%2522%252C%2522sizes%2522%253A%255B100%252C0%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clummlcvv00023j6kt34jzu2m%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clummlcvv00033j6kwkzzecou%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clummlcvv00053j6k5huyiakv%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B40%252C60%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clummlcvv00023j6kt34jzu2m%2522%253A%257B%2522id%2522%253A%2522clummlcvv00023j6kt34jzu2m%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clumou7n600023j6kk3w5wbjr%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A2%252C%2522startColumn%2522%253A29%252C%2522endLineNumber%2522%253A2%252C%2522endColumn%2522%253A29%257D%255D%252C%2522filepath%2522%253A%2522%252Fsrc%252FApp.tsx%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clumou7n600023j6kk3w5wbjr%2522%257D%252C%2522clummlcvv00053j6k5huyiakv%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clummlcvv00043j6kp9std1xt%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clummlcvv00053j6k5huyiakv%2522%252C%2522activeTabId%2522%253A%2522clummlcvv00043j6kp9std1xt%2522%257D%252C%2522clummlcvv00033j6kwkzzecou%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clummlcvv00033j6kwkzzecou%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Afalse%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
Steps to Reproduce the Bug or Issue
Component code:
Expected behavior
As a user, I expected to receive a checkbox on my screen and have the possibility to interact with it.
Screenshots or Videos
I see nothing.
![Знімок екрана 2024-04-24 191229](https://private-user-images.githubusercontent.com/48633319/325299242-ce3f29e4-9552-49bf-b798-03b5e26b024e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTcxNDIsIm5iZiI6MTczOTE1Njg0MiwicGF0aCI6Ii80ODYzMzMxOS8zMjUyOTkyNDItY2UzZjI5ZTQtOTU1Mi00OWJmLWI3OTgtMDNiNWUyNmIwMjRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDAzMDcyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3ODE4NDFlZDc4ODRkZmNjZGFjZmNhYTU3NjAyMDZmYWE1MDNhZjA0MGI5ZTI0YmI3NjI5MDllMTI0ZWU5YWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YjTNfB6B6Wp3R1t9QS1VXlwgJiO4b6r7IOGOCw6T488)
Only errors:
Operating System Version
Windows 11
Browser
Chrome
The text was updated successfully, but these errors were encountered: