Skip to content
Bug reportNov 21, 2026· 0:29· 10 views

antd 6.7.1: Badge ScrollNumber animates the wrong direction after an unchanged-digit update

0:29 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

lowantd Badge / ScrollNumber component: how the previous value is tracked per digit for scroll direction. The previous count appears not to update when a digit's value is unchanged (5 → 15 keeps ones at 5). The next change then computes direction against a stale value.
os: macOSdpr: 1page: antd Badge ScrollNumber direction bug (repro page)locale: en-USbrowser: Chromium 151.0.7922.34library: antd 6.7.1 (per page heading at 1.0s)timezone: Europe/Berlinviewport: 1280x720related_issue: ant-design/ant-design#59930 (per page subtitle at 1.0s)

Repro steps

  1. 1.Open the repro page. The Badge shows 5 and the status line says count = 5, ones digit is 5.
  2. 2.Click the 'Set 15' button. The ones digit stays 5 while the tens digit is added.
  3. 3.Click the 'Set 14' button. Watch the ones digit animate from 5 to 4.
  4. 4.Optional: click 'Reset to 5', then 'Set 15', then 'Set 14' to repeat the sequence.

Expected

When the count goes from 15 to 14, the ones digit should scroll down one step from 5 to 4. The direction should be based on the actual previous value of 15.

Actual

After 15 → 14, the page status line labels the transition as a bug: the ones digit scrolls up 9 steps instead of down 1. The final value shown is correct (14). The preceding 5 → 15 update left the ones digit unchanged, and the page reports prevCount as stuck at 5.

Evidence

visualStarting state: the badge shows 5. The status line says count = 5 at start, with ones digit 5.
visualControl case, works: after clicking 'Set 15' at 6.7s, the badge correctly shows 15 and widens from a circle to a pill. The status line says the ones digit stays 5 and prevCount is stuck at 5.
visualFailing case: after clicking 'Set 14' at 12.1s, the badge shows 14. The status line reads 'count = 14 (← bug: ones scrolls UP 9 steps instead of DOWN 1)'.
visualBadge still shows 14 with the same bug status text. The final value is correct. Only the animation direction is reported as wrong.
visualControl case, works: 'Reset to 5' clicked at 16.2s returns the badge to a single-digit 5. The status line says count = 5 after reset.
visualRepeat run: 'Set 15' clicked at 18.4s. The badge shows 15 with the same prevCount stuck at 5 status.
visualSecond 'Set 14' click at 23.1s. The 23.0s frame shows the button highlighted while the badge still reads 15. No later frame shows the result.
Issue markdown (copy-paste ready)
## antd 6.7.1 Badge ScrollNumber: ones digit scrolls the wrong way after an unchanged-digit update

Related: ant-design/ant-design#59930 (per repro page subtitle, 1.0s)

### Environment
- antd 6.7.1 (page heading, 1.0s)
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, DPR 1, en-US, Europe/Berlin

### Steps to reproduce
1. Open the repro page. The Badge shows `5` (1.0s).
2. Click **Set 15** (6.7s). The badge shows `15`. The ones digit stays 5 (9.0s).
3. Click **Set 14** (12.1s). Watch the ones digit animate from 5 to 4.

### Expected
The ones digit scrolls **down 1 step** from 5 to 4.

### Actual
The page status line labels the transition as a bug: the ones digit scrolls **up 9 steps** instead of down 1 (13.0s). The final value `14` is correct. Only the animation direction is wrong. The page reports that prevCount stayed at 5 after the 5 → 15 update, because the ones digit did not change (9.0s).

### Control cases (work correctly)
- 5 → 15 renders `15` correctly and the badge widens to fit two digits (9.0s).
- **Reset to 5** (16.2s) returns the badge to a single-digit `5` (17.0s).

### Evidence
- 1.0s: badge `5`, status says count = 5 at start, ones digit 5.
- 9.0s: badge `15`, status `count = 15 (ones stays 5 → prevCount stuck at 5)`.
- 13.0s: badge `14`, status `count = 14 (← bug: ones scrolls UP 9 steps instead of DOWN 1)`.
- 19.0s: repeat run reaches `15` with the same stuck-prevCount status.
- 23.1s: second **Set 14** click. No later frame shows the result.

No console or network events were captured.

### Suggested area
Badge / ScrollNumber per-digit previous-value tracking. The previous count seems not to update when a digit's value is unchanged. The next transition then picks its scroll direction from a stale value.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
antd 6.7.1: Badge ScrollNumber animates the wrong direction after an unchanged-digit update · SceneRecap