-
Notifications
You must be signed in to change notification settings - Fork 268
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
docs: popup 增加 taro ios 兼容 faq #2943
Conversation
变更概览遍历文档 变更
可能相关的 PR
建议的审阅者
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/packages/popup/doc.taro.md (1)
139-141
: 建议完善 FAQ 内容为了使文档更加清晰和实用,建议:
- 添加具体的代码示例,展示如何实现样式的添加和移除
- 解释在 iOS 上出现此问题的原因
- 说明此问题影响的 iOS 版本范围
建议按如下方式扩展内容:
## FAQ -在 iOS 下,有时候 `lockScroll` 可能不生效,此刻在打开 `popup` 时,可将宿主页面的样式增加 `overflow: hidden;`,关闭弹层时,再重置样式。 +### iOS 下 lockScroll 失效问题 + +在 iOS 系统中,某些版本下 `lockScroll` 属性可能会失效。这是由于 iOS WebView 对 overflow 处理机制的特殊性导致的。 + +#### 解决方案 + +可以通过手动控制宿主页面的样式来解决此问题: + +```tsx +const App = () => { + const [visible, setVisible] = useState(false) + + const handlePopupOpen = () => { + document.body.style.overflow = 'hidden' + setVisible(true) + } + + const handlePopupClose = () => { + document.body.style.overflow = 'auto' + setVisible(false) + } + + return ( + <Popup + visible={visible} + onOpen={handlePopupOpen} + onClose={handlePopupClose} + > + 弹窗内容 + </Popup> + ) +} +```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/packages/popup/doc.taro.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (1)
src/packages/popup/doc.taro.md (1)
139-141
: 很好的补充说明!FAQ 部分的添加对于解决 iOS 设备上的特定问题很有帮助。
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
lockScroll
属性在 iOS 设备上使用的解决方案建议