Edit-list macro- Field removed instead of clearing the input

When trying to clear the input using the x button shown by the edit-list macro, the field is removed from the tiddler instead of just input being cleared. I have attached a JSON
file containing the 3 tiddlers involved:

  1. FieldEditorFilter
  2. FieldEditTemplate
  3. Test
    In the Test tiddler, the field named foo uses the edit-list macro. When I try to clear its value using the button displayed, the field itself gets removed. Why is this happening?

tiddlers.json (595 Bytes)

That behavior (removing the field when pressing [x]) was the intended action. The thinking was that, if the field doesn’t exist when you enter a value, it is automatically created. Clearing the field value would then do the inverse behavior and automatically delete the field so that the final state of the tiddler would be the same as it’s initial state.

However… I can see how just clearing the field without deleting it also makes sense for many use-cases, especially if the field actually did exist before you entered a value.

To address this, I’ve just updated the handling so the default is now to only clear the field, without deleting it. If you DO want to also delete the field, you can now use the “shift” key modifier while clicking on the [x] button to get the previous behavior.

Get the latest revision here: EditListMacro — TiddlyTools: "Small Tools for Big Ideas!" (tm)

enjoy,
-e

1 Like

Hi Eric,
This is a ide note:
Wonderful solution: EditListMacro — TiddlyTools: “Small Tools for Big Ideas!” ™

I love the small table of content for this long tiddler and the return to top buttons!
The structure reminds me of your great classic TiddlyTools.

This tiddler (TiddlyTools/Macros/edit-list/Info) has a lot to learn !

Thank you

Oh, wonderful! Thanks, Eric!