shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

Button acts on active file rather than file it's placed in #66

Closed camdroid closed 5 months ago

camdroid commented 2 years ago

When clicking a button, the button acts on the active file, rather than the file the button is in.

In the attached video, the "Shaken" and "OK" buttons act as expected when clicked on while the "Andrea" file has focus, changing the third line of the file to Status: [[Shaken]] or Status: OK, respectively. When the "Test Encounter" file has focus and the user clicks on the button from the hover preview of the "Andrea" file, the button acts on the "Test Encounter" file, even though there are no buttons in that file.

https://user-images.githubusercontent.com/189652/129131185-68c680d1-2646-45f6-b225-45051a82a0f5.mov

shabegom commented 2 years ago

whoa. triggering a button from the hover preview is not a use-case I had imagined.

You're right in that the Button is expecting to be the active pane when triggered and so there isn't logic beyond grabbing the active pane.

I'll need to support this use-case when building sidebar buttons, so will probably look at fixing then.