We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When this Carousel component is placed inside a form element, it causes the entire page to refresh.
Carousel
<FormItem className='w-full items-baseline'> <FormControl> <Input id='electricity-annual-consumption' className='h-11' placeholder='Geben Sie Ihren Strombedarf ein' {...field} onChange={(event) => { const { value } = event.target if (/^\d*$/.test(value)) { field.onChange(value) } }} /> </FormControl> <FormMessage /> <div> <Carousel opts={{ align: "start", }} className='w-full max-w-sm' > <CarouselContent> {Array.from({ length: 5 }).map((_, index) => ( <CarouselItem key={index} className='md:basis-1/2 lg:basis-1/3'> <div className='p-1'> <Card> <CardContent className='flex aspect-square items-center justify-center p-6'> <span className='text-3xl font-semibold'>{index + 1}</span> </CardContent> </Card> </div> </CarouselItem> ))} </CarouselContent> <CarouselPrevious /> <CarouselNext /> </Carousel> </div> <Button disabled={!isElectricityConsumptionValid(parseInt(value, 10))} variant='ghost' className='text-blue-500 hover:text-blue-600 w-full' onClick={() => setIsElectrictyDemandEditable(false)} > Speichern </Button> </FormItem>
https://jam.dev/c/7429742c-aff6-4f54-8438-d1b00e55f069
No response
OS: Linux Browser: Chrome
The text was updated successfully, but these errors were encountered:
It's resolved by adding onClick={(e) => e.preventDefault()} to the Carousel component.
onClick={(e) => e.preventDefault()}
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When this Carousel component is placed inside a form element, it causes the entire page to refresh.
Problem Summary:
ba831df9-d410-4952-9e89-bf5edf4e9305.webm
Affected component/components
Carousel
How to reproduce
ba831df9-d410-4952-9e89-bf5edf4e9305.webm
Code
Codesandbox/StackBlitz link
https://jam.dev/c/7429742c-aff6-4f54-8438-d1b00e55f069
Logs
No response
System Info
Before submitting
The text was updated successfully, but these errors were encountered: