Skip to content

Commit 7e81e7a

Browse files
committed
Make options optional scrollFade, scrollShadow, and sticky actions
1 parent b69b6c7 commit 7e81e7a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Diff for: .changeset/brave-rats-camp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'svelte-ux': patch
33
---
44

5-
Fix: Make ScrollFadeOptions optional in `scrollFade` action
5+
Make options optional `scrollFade`, `scrollShadow`, and `sticky` actions

Diff for: packages/svelte-ux/src/lib/actions/scroll.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ type ScrollShadowOptions = {
4848
};
4949
};
5050

51-
export const scrollShadow: Action<HTMLElement, ScrollShadowOptions> = (node, options) => {
51+
export const scrollShadow: Action<HTMLElement, ScrollShadowOptions | undefined> = (
52+
node,
53+
options
54+
) => {
5255
const defaultOptions = {
5356
offset: 10,
5457
blur: 6,
@@ -169,7 +172,7 @@ type ScrollFadeOptions = {
169172
scrollRatio?: number;
170173
};
171174

172-
export const scrollFade: Action<HTMLElement, ScrollFadeOptions> = (node, options?) => {
175+
export const scrollFade: Action<HTMLElement, ScrollFadeOptions | undefined> = (node, options) => {
173176
const length = options?.length ?? 50;
174177
const scrollRatio = options?.scrollRatio ?? 5;
175178

Diff for: packages/svelte-ux/src/lib/actions/sticky.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type StickyOptions = {
1313
TODO
1414
- [ ] Consider raising a `stuck` event for styling (example: https://svelte.dev/repl/4ad71e00c86c47d29806e17f09ff0869?version=3.35.0)
1515
*/
16-
export const sticky: Action<HTMLElement, StickyOptions> = (node, options) => {
16+
export const sticky: Action<HTMLElement, StickyOptions | undefined> = (node, options) => {
1717
// Track changes so they can be reversed on an update
1818
const tracker = new DomTracker(node);
1919

0 commit comments

Comments
 (0)