【发布时间】:2020-03-05 10:23:31
【问题描述】:
当我将鼠标悬停在 Ant Design 的 Rate 组件中的星上时,它的大小会增加,而在鼠标移开时,它会恢复到原始大小。这可能是由于组件中固有的transform: scale(x)。如果我将鼠标悬停在星星上,我想停止星星的动画/行为。我怎样才能做到这一点?我在 devtools 中尝试过不同的element state,但失败了。
我可以设置自定义 width 和 height 但我找不到可以停止该动画/转换的东西 :/ 。 code sandbox
.ant-rate-star.ant-rate-star-full i svg {
width: 15px;
height: 20px;
margin: -3.5px;
}
.ant-rate-star.ant-rate-star-zero i svg {
width: 15px;
height: 20px;
margin: -3.5px;
}
.ant-rate-star.ant-rate-star-half.ant-rate-star-active i svg {
width: 15px;
height: 20px;
margin: -3.5px;
}
.ant-rate-star.ant-rate-star-full i svg:hover {
transform: scale(1); //not working
}
【问题讨论】: