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(DropdownItem): incorrect offset of van-dropdown-item when inside popup #10846

Closed
wants to merge 3 commits into from
Closed

fix(DropdownItem): incorrect offset of van-dropdown-item when inside popup #10846

wants to merge 3 commits into from

Conversation

JakeLaoyu
Copy link
Contributor

@chenjiahan
Copy link
Member

chenjiahan commented Jul 30, 2022

这个修复会导致 Popup 设置 position: bottom 时,DropdownItem 的定位出现问题。

因为定位偏移 bug 的本质原因还是 transform 导致 fixed 布局降级,不是所有的 Popup 都会设置 transform 属性

@chenjiahan
Copy link
Member

这个 bug 没修就是因为没想到什么优雅的处理方式。。

@JakeLaoyu
Copy link
Contributor Author

除非能不用 transform,或者给一个参数允许使用者手动处理?

@chenjiahan
Copy link
Member

弹窗居中布局的话,还是 transform 最合适,其他方式难搞。

不推荐为特定场景加 props,props 一般会设计成通用型的;倒是可以研究下 DropdownItem 不使用 fixed 布局能否实现。

@JakeLaoyu
Copy link
Contributor Author

嗯哪

@JakeLaoyu JakeLaoyu closed this by deleting the head repository Sep 13, 2022
@blachworld
Copy link

@chenjiahan 请教一下, 弹窗居中布局的话,不使用transform来实现,居中给一个默认的宽度 ,这样子有什么问题吗

@chenjiahan
Copy link
Member

业务里这么用没什么问题,组件库不适合写死宽度

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