Skip to content

Commit

Permalink
fix(swiper): unexpected high frequency left and right jitter (#2603)
Browse files Browse the repository at this point in the history
  • Loading branch information
betavs authored Feb 27, 2024
1 parent c543fb1 commit d49f305
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/swiper/swiper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default class Swiper extends SuperComponent {

this.setData({
navCurrent: current,
current,
});

this.triggerEvent('change', { current, source });
Expand Down
4 changes: 2 additions & 2 deletions src/swiper/swiper.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<swiper-item
wx:for="{{list}}"
wx:key="index"
class="{{_.cls(classPrefix + '__item', [['preview', this.isPrev(current, index, list)], ['next', this.isNext(current, index, list)]])}}"
class="{{_.cls(classPrefix + '__item', [['preview', this.isPrev(navCurrent, index, list)], ['next', this.isNext(navCurrent, index, list)]])}}"
data-index="{{index}}"
bind:tap="onTap"
aria-hidden="{{navCurrent !== index}}"
Expand All @@ -32,7 +32,7 @@
>
<template
is="image"
data="{{ class: classPrefix + '__image-host', tClass: this.getImageClass(prefix, current, index, list), style: 'height: ' + _.addUnit(height), src: _.isObject(item) ? item.value : item, mode: 'aspectFill', dataset: index, ...imageProps, bindload: 'onImageLoad' }}"
data="{{ class: classPrefix + '__image-host', tClass: this.getImageClass(prefix, navCurrent, index, list), style: 'height: ' + _.addUnit(height), src: _.isObject(item) ? item.value : item, mode: 'aspectFill', dataset: index, ...imageProps, bindload: 'onImageLoad' }}"
/>
</swiper-item>
</swiper>
Expand Down

0 comments on commit d49f305

Please sign in to comment.