Skip to content
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

Wrong embla-carousel-svelte init event types #464

Closed
1 task done
Tracked by #321
davidjerleke opened this issue Apr 27, 2023 · 1 comment · Fixed by #465
Closed
1 task done
Tracked by #321

Wrong embla-carousel-svelte init event types #464

davidjerleke opened this issue Apr 27, 2023 · 1 comment · Fixed by #465
Labels
bug Something isn't working resolved This issue is resolved svelte Issue is related to Svelte typescript Issue is related to TypeScript

Comments

@davidjerleke
Copy link
Owner

Bug is related to

  • embla-carousel-svelte

Embla Carousel version

  • v7.1.0

Describe the bug

  • When using the on:init event with TypeScript, the following error shows:
Argument of type '{ class: string; "on:init": (event: CustomEvent<EmblaCarouselType>) => void; }' is not assignable to parameter of type 'Omit<Omit<HTMLAttributes<HTMLDivElement>

The problem can be solved by adding the following to a d.ts file:

declare namespace svelteHTML {
  interface HTMLAttributes<T> {
    'on:emblaInit'?: (event: any) => any
  }
}

...which is very hacky and not desired.

Expected behavior

@davidjerleke davidjerleke added bug Something isn't working svelte Issue is related to Svelte labels Apr 27, 2023
davidjerleke added a commit that referenced this issue Apr 27, 2023
@davidjerleke davidjerleke linked a pull request Apr 27, 2023 that will close this issue
@davidjerleke
Copy link
Owner Author

Will be released with v8.0.0-rc02.

davidjerleke added a commit that referenced this issue Apr 27, 2023
@davidjerleke davidjerleke added resolved This issue is resolved typescript Issue is related to TypeScript labels Apr 28, 2023
@davidjerleke davidjerleke mentioned this issue Apr 28, 2023
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved svelte Issue is related to Svelte typescript Issue is related to TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant