The ticket says: "I pressed Cancel and it deleted my draft."
You open the code. The Cancel handler cancels. The Delete handler deletes. Nothing is crossed, nothing is mislabelled, and the click that arrived went to Delete because Delete was genuinely under that finger at the moment it landed. Both of you are describing the same event correctly and neither description contains the cause.
Something above those buttons changed size about eighty milliseconds earlier.
The browser already has a defence, and you have probably never configured it
There is a feature aimed squarely at this class of problem. MDN:
Scroll anchoring behavior adjusts scroll position to minimize content shifts.
And the line that explains why you have never thought about it:
Scroll anchoring behavior is enabled by default in any browser that supports it.
It works silently, so it is invisible until it is absent. Two things about it are worth holding.
It is one line to switch off.…