Skip to content

Commit

Permalink
Fix/notice bar/unexpected animation (#3008)
Browse files Browse the repository at this point in the history
* fix(notice-bar): fix the problem of non-expected translate animation

issue: when entering the page, occasionally a translteX animation is initiated when the content of
the notice-bar actually wraps and fits in the notice bar

#3077

* fix(notice-bar): update snap

* chore: update snapshot

* fix(notice-bar): 'ready' changed to pure data

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jby0107 and github-actions[bot] authored Jul 26, 2024
1 parent fecc35b commit 79e6978
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/notice-bar/notice-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class NoticeBar extends SuperComponent {

options: ComponentsOptionsType = {
multipleSlots: true,
pureDataPattern: /^__/,
};

properties = props;
Expand All @@ -34,6 +35,7 @@ export default class NoticeBar extends SuperComponent {
prefix,
classPrefix: name,
loop: -1,
__ready: false,
};

observers = {
Expand All @@ -50,6 +52,7 @@ export default class NoticeBar extends SuperComponent {
},

visible(visible) {
if (!this.data.__ready) return;
if (visible) {
this.show();
} else {
Expand All @@ -68,6 +71,7 @@ export default class NoticeBar extends SuperComponent {
},

content() {
if (!this.data.__ready) return;
this.clearNoticeBarAnimation();
this.initAnimation();
},
Expand All @@ -87,6 +91,7 @@ export default class NoticeBar extends SuperComponent {

ready() {
this.show();
this.setData({ __ready: true });
},
};

Expand Down

0 comments on commit 79e6978

Please sign in to comment.