mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
fix: Safari Badge scroll number missing
This commit is contained in:
parent
776cd5f5eb
commit
28b11e9173
@ -79,23 +79,29 @@ const SingleNumber: React.FC<Readonly<SingleNumberProps>> = (props) => {
|
||||
unitNumberList.push(index);
|
||||
}
|
||||
|
||||
const unit = prevCount < count ? 1 : -1;
|
||||
|
||||
// Fill with number unit nodes
|
||||
const prevIndex = unitNumberList.findIndex((n) => n % 10 === prevValue);
|
||||
unitNodes = unitNumberList.map((n, index) => {
|
||||
|
||||
// Cut list
|
||||
const cutUnitNumberList =
|
||||
unit < 0 ? unitNumberList.slice(0, prevIndex + 1) : unitNumberList.slice(prevIndex);
|
||||
|
||||
unitNodes = cutUnitNumberList.map((n, index) => {
|
||||
const singleUnit = n % 10;
|
||||
return (
|
||||
<UnitNumber
|
||||
{...props}
|
||||
key={n}
|
||||
value={singleUnit}
|
||||
offset={index - prevIndex}
|
||||
offset={unit < 0 ? index - prevIndex : index}
|
||||
current={index === prevIndex}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
// Calculate container offset value
|
||||
const unit = prevCount < count ? 1 : -1;
|
||||
offsetStyle = {
|
||||
transform: `translateY(${-getOffset(prevValue, value, unit)}00%)`,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user