shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

Clicking button adds text, but immediately rolls back / undo #119

Closed mr-nano closed 5 months ago

mr-nano commented 2 years ago

I have a button like

name Mark as reviewed today
type prepend text
action - Revisited on [[<% tp.date.now("YYYY-MM-DD") %>]] at <% tp.date.now("hh:mm:ss") %>
color blue
templater true

and when I click on it I see it add the corresponding text, but then immediately delete it too. It has started happening a couple of months ago. I'm using obsidian version 0.14.15 and latest buttons.

DanielJHardy commented 2 years ago

I've also just ran into this.

Happens when 'templater' is included. Setting to true or false makes no difference. Spamming the button makes it stick, sometimes, but it also doesn't revert the template code in the action field, leaving it hard-coded.

obsidianspear commented 2 years ago

Also experiencing this issue. Mostly with templater.

joecanhelp commented 1 year ago

I've also just ran into this. Inserting a text with templater or inserting from template with templater gets the same issue. However, creating a note from template with templater is correct.

augustinharter commented 1 year ago

I have the same issue. Even with the one example button from the documentation:

name Log
type append text
action <% tp.date.now("HH:mm") %>
templater true
rjclark commented 1 year ago

I hit the same problem and did some experimenting.

This fails (text added and then immediately removed)

name Start
type append template
action Start Template
templater true
color blue

This works and even correctly inserts the template with all variables resolved ¯\_(ツ)_/¯

name Start
type append template
action Start Template
color blue

Since I don't need templater commands in the button I'm not sure why I had that included, but removing it was the right choice for me.