Skip to content

Commit

Permalink
chore(clickoutside): change event listener typing
Browse files Browse the repository at this point in the history
  • Loading branch information
vnphanquang committed May 17, 2024
1 parent 8200be5 commit 2bca84d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-hornets-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svelte-put/clickoutside": major
---

`onclickoutside` is now `onclickoutside` (see Svelte 5 docs)
2 changes: 1 addition & 1 deletion packages/clickoutside/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This package is part of the [@svelte-put][github.monorepo] family. For contribut
}
</script>

<div use:clickoutside on:clickoutside="{doSomething}" />
<div use:clickoutside onclickoutside="{doSomething}" />
```

## [Changelog][github.changelog]
Expand Down
2 changes: 1 addition & 1 deletion packages/clickoutside/src/clickoutside.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <aside
* class="absolute top-0 left-0 right-0 bottom-0"
* use:clickoutside={{ limit: { parent: containerNode }}}
* on:clickoutside={onClickOutside}
* onclickoutside={onClickOutside}
* >
* ...some modal content...
* </aside>
Expand Down
6 changes: 3 additions & 3 deletions packages/clickoutside/src/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { ActionReturn, Action } from 'svelte/action';
* import { clickoutside } from '@svelte-put/clickoutside';
* </script>
*
* <!-- on:clickoutside should be typed -->
* <!-- onclickoutside should be typed -->
* <div
* use:clickoutside
* on:clickoutside
* onclickoutside
* />
* ```
*/
export interface ClickOutsideAttributes {
'on:clickoutside'?: (event: CustomEvent<MouseEvent>) => void;
'onclickoutside'?: (event: CustomEvent<MouseEvent>) => void;
}

/**
Expand Down

0 comments on commit 2bca84d

Please sign in to comment.