Open coder-karen opened 6 months ago
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
What is the issue
On a self-hosted site using the Jetpack plugin, once a Donation block is added to a post or page it isn't possible to remove it with the undo button. With most other blocks, after adding the block and making none or a few changes, clicking the undo button will undo any changes and then remove the block (as a demo you can try with the Business Hours block).
To reproduce:
Demo:
https://github.com/Automattic/jetpack/assets/16754605/4a09e214-5a1f-4253-826f-8245aaff5755
Originally reported here: https://github.com/Automattic/jetpack/issues/35505#issuecomment-1932230242
Likely next steps
The issue is that we set the attributes for
oneTimeDonation
,monthlyDonation
andannualDonation
within auseEffect
(seeprojects/plugins/jetpack/extensions/blocks/donations/tabs.js
) which checks first to see if those values are set and that the planID matches the respective products value. The products value is set by doing a fetch request to WordPress.com (seeprojects/plugins/jetpack/extensions/blocks/donations/edit.js
), and theoneTimeDonation
,monthlyDonation
andannualDonation
attributes only set once that is received.This happens on initial load, so clicking undo just repeats the fetch and setting of attributes.
Possible solutions (I've not looked into the feasibility of any of these):