Skip to content

Commit

Permalink
feat: validate preventExcessiveDragging carousel prop and log warning
Browse files Browse the repository at this point in the history
  • Loading branch information
aovcina committed Jan 4, 2025
1 parent c4b4546 commit 9e52864
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/Carousel/carouselProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ export const carouselProps = {
},
preventExcessiveDragging: {
default: false,
type: Boolean
type: Boolean,
validator(value: boolean, props) {

Check failure on line 127 in src/components/Carousel/carouselProps.ts

View workflow job for this annotation

GitHub Actions / test (typecheck)

Parameter 'props' implicitly has an 'any' type.
if (value && props.wrapAround)
console.warn(

Check failure on line 129 in src/components/Carousel/carouselProps.ts

View workflow job for this annotation

GitHub Actions / test (lint)

Unexpected console statement
'[vue3-carousel warn]: preventExcessiveDragging cannot be used with wrapAround. ' +
'The preventExcessiveDragging setting will be ignored.'
);

return true;
}
}
}

0 comments on commit 9e52864

Please sign in to comment.