Skip to content

Conversation

flyerH
Copy link
Contributor

@flyerH flyerH commented Aug 19, 2020

fix ant-design/ant-design#26241

Popup的status为null时,弹出的picker组件opacity为0,但鼠标依然可以选择上面的日期,导致了issue那个问题

image
image

@kerm1it
Copy link
Member

kerm1it commented Aug 28, 2020

@flyerH CI 失败了

@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #194 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
src/Popup.tsx 90.64% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 333234e...e17752d. Read the comment docs.

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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 visible 是不是改为 undefined 更好点,不然会给DOM添加额外样式

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉还有个问题,如果之前弹出层渐隐渐现的动画效果绑定的是opacity,那光改成visibility还不行
我一起研究一下

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个感觉应该不会有影响吧,只是 hidden 的时候看不见动画效果,和原来的 opacity:0 的 效果一样的。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或者就是在原来的基础上叠加一层 pointer-events:none;, 让点击透传。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointer-events只支持到IE11,这个有影响吗

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得还是 visibility 属性更好,帮忙看看 @zombieJ

Copy link
Member

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 用户就……

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE 11 应该可以了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@zombieJ zombieJ merged commit 09224c9 into react-component:master Aug 28, 2020
@zombieJ
Copy link
Member

zombieJ commented Aug 28, 2020

+ rc-trigger@4.4.1 pls check

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.

RangePicker在未设置默认值的前提下,首次渲染后首次点击,为什么会出现默认值?再次点击又没有了?
3 participants