-
Notifications
You must be signed in to change notification settings - Fork 113
feat: Implement scrollTo method for x-swiper component #1197
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b69d2b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
251e379
to
e472916
Compare
❌ 1 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
CodSpeed Performance ReportMerging #1197 will not alter performanceComparing Summary
|
Web Explorer#2553 Bundle Size — 259.26KiB (-0.1%).b69d2b0(current) vs ae3a1a8 main#2540(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch copilot/fix-1196 Project dashboard Generated by RelativeCI Documentation Report issue |
React Example#2562 Bundle Size — 234.7KiB (0%).b69d2b0(current) vs ae3a1a8 main#2549(baseline) Bundle metrics
|
Current #2562 |
Baseline #2549 |
|
---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
153 |
153 |
|
61 |
61 |
|
45.85% |
45.85% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
Current #2562 |
Baseline #2549 |
|
---|---|---|
145.76KiB |
145.76KiB |
|
88.94KiB |
88.94KiB |
Bundle analysis report Branch copilot/fix-1196 Project dashboard
Generated by RelativeCI Documentation Report issue
…lToPrevious Co-authored-by: PupilTong <[email protected]>
1fda223
to
b69d2b0
Compare
This PR implements a new
scrollTo
method for thex-swiper
component that replaces the existingscrollToNext
andscrollToPrevious
methods, providing a more flexible and standardized scrolling API.Changes Made
Removed Methods
scrollToNext()
- Previously allowed scrolling to the next swiper itemscrollToPrevious()
- Previously allowed scrolling to the previous swiper itemAdded Method
scrollTo()
- New method with multiple overloads supporting both standard HTML usage and custom x-swiper functionalityAPI Usage
The new
scrollTo
method supports both standard HTMLscrollTo
usage and a new custom usage:Implementation Details
scrollTo
usage continues to work unchanged#scrollToIndex
private method for consistencysmooth
parameter defaults totrue
for the custom usageTest Coverage
Added comprehensive test file
x-swiper-scroll-to.html
with interactive buttons to validate:The implementation follows the same pattern as the existing
ScrollView
component'sscrollTo
method, ensuring consistency across the codebase.Fixes #1196.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.