buttons icon indicating copy to clipboard operation
buttons copied to clipboard

Clicking button adds text, but immediately rolls back / undo

Open mr-nano opened this issue 2 years ago • 5 comments

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.

mr-nano avatar Jun 17 '22 13:06 mr-nano

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.

DanielJHardy avatar Jun 19 '22 15:06 DanielJHardy

Also experiencing this issue. Mostly with templater.

obsidianspear avatar Jun 21 '22 19:06 obsidianspear

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.

pilifan avatar Jul 13 '22 09:07 pilifan

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

augustinharter avatar Aug 08 '22 20:08 augustinharter

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.

rjclark avatar Sep 09 '22 19:09 rjclark