-
-
Notifications
You must be signed in to change notification settings - Fork 237
fix: component can still be selected when disabled #194
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
Conversation
@flyerH CI 失败了 |
Codecov Report
@@ Coverage Diff @@
## master #194 +/- ##
==========================================
+ Coverage 85.62% 85.65% +0.02%
==========================================
Files 7 7
Lines 508 509 +1
Branches 142 143 +1
==========================================
+ Hits 435 436 +1
Misses 73 73
Continue to review full report at Codecov.
|
src/Popup.tsx
Outdated
@@ -303,7 +303,7 @@ class Popup extends Component<PopupProps, PopupState> { | |||
...sizeStyle, | |||
...this.getZIndexStyle(), | |||
...style, | |||
opacity: status === 'stable' || !visible ? undefined : 0, | |||
visibility: status === 'stable' || !visible ? 'visible' : 'hidden', |
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.
这里的 visible 是不是改为 undefined
更好点,不然会给DOM添加额外样式
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.
感觉还有个问题,如果之前弹出层渐隐渐现的动画效果绑定的是opacity,那光改成visibility还不行
我一起研究一下
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.
这个感觉应该不会有影响吧,只是 hidden 的时候看不见动画效果,和原来的 opacity:0
的 效果一样的。
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.
或者就是在原来的基础上叠加一层 pointer-events:none;
, 让点击透传。
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.
pointer-events
只支持到IE11,这个有影响吗
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.
我觉得还是 visibility
属性更好,帮忙看看 @zombieJ
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.
visibility
hidden 会影响一些 ResizeObserver 的测量。用 pointer-events
好了,IE 用户就……
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.
IE 11 应该可以了。
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.
ok
|
fix ant-design/ant-design#26241
Popup的status为null时,弹出的picker组件opacity为0,但鼠标依然可以选择上面的日期,导致了issue那个问题