fix: fix click button will also enter edit

This commit is contained in:
Eritque arcus 2025-11-09 23:56:00 -06:00
parent 6614713042
commit 100c1c5bad
No known key found for this signature in database
GPG key ID: B95AA12EA8C8C3AE

View file

@ -31,7 +31,9 @@ export default class PseudocodePlugin extends Plugin {
const blockWidth = this.settings.blockSize;
blockDiv.style.width = `${blockWidth}em`;
blockDiv.addEventListener("click", (event) => {
((event.target as HTMLElement)
const target = (event.target as HTMLElement)!;
if(target.tagName !== 'BUTTON')
(target
.closest('.pseudocode-block')!
.parentElement!.parentElement!
.querySelector('.edit-block-button') as HTMLElement)!