Skip to content
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

fix:(Swipe): Fix swipe auto play when element is hidden #12306

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from

Conversation

godky
Copy link

@godky godky commented Sep 20, 2023

如果父元素初始样式有display:none;随后再展示,轮播组件会异常

@codecov-commenter
Copy link

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
src/swipe/index.js 100.00%

📢 Thoughts on this report? Let us know!.

@godky godky changed the title fix:(Swipe): Fix 'read properties of null' issue when initialize method is returned by isHidden fix:(Swipe): Fix swipe auto play when element is hidden Sep 20, 2023
@chenjiahan
Copy link
Member

这个问题更合适的修复方式是使用 Vant 里的 useVisibilityChange 方法,不过这个方法依赖 IntersectionObserver,存在兼容性问题

@godky
Copy link
Author

godky commented Sep 20, 2023

这个问题更合适的修复方式是使用 Vant 里的 useVisibilityChange 方法,不过这个方法依赖 IntersectionObserver,存在兼容性问题

嗯,确实

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants