Skip to content

Commit

Permalink
fix: issue when text is not overflow (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinzzq authored and Phieo committed Feb 25, 2019
1 parent c438f67 commit 0690b6f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/notice/index.ts
@@ -1,5 +1,6 @@
const noop = () => {};
const canIUseTransitionEnd = my.canIUse('view.onTransitionEnd');

Component({
props: {
className: '',
Expand Down Expand Up @@ -83,11 +84,13 @@ Component({
.boundingClientRect()
.exec((ret) => {
const overflowWidth = (ret && ret[0] && ret[1] && (ret[0].width - ret[1].width)) || 0;
this.setData({
overflowWidth,
duration: (overflowWidth / fps),
});
callback();
if (overflowWidth > 0) {
this.setData({
overflowWidth,
duration: (overflowWidth / fps),
});
callback();
}
});
},

Expand Down

0 comments on commit 0690b6f

Please sign in to comment.