Since the 24.07 update, the behavior of the undo button for the scratchpad has changed to clear all when pressed, as opposed to undoing stroke-by-stroke or clearing all when held.
The option Preferences -> Review -> Scratchpad -> Undo Clears All
is switched off. Switching it on does not produce the opposite behavior.
Edit: When looking at the backside of a card, the undo button seems to work as intended. When looking at the front (the side you look at when reviewing, in case I got the terminology mixed up), it still clears all.