From 8654066f0341fe7f84538568f2dda3c15dc2c033 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Thu, 21 Oct 2021 09:21:00 +0100 Subject: [PATCH] Remove docs about editing a field of the containing tiddler Doesn't apply post v5.2.0 --- .../tiddlers/widgets/EditTextWidget.tid | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid index f1a8bb453..7cde23345 100644 --- a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid @@ -1,6 +1,6 @@ caption: edit-text created: 20131024141900000 -modified: 20210519154352055 +modified: 20211021091910134 tags: Widgets title: EditTextWidget type: text/vnd.tiddlywiki @@ -37,25 +37,3 @@ The content of the `<$edit-text>` widget is ignored. |refreshTitle |<<.from-version 5.1.23>> An optional tiddler title that makes the input field update whenever the specified tiddler changes | |disabled|<<.from-version "5.1.23">> Optional, disables the text input if set to "yes". Defaults to "no"| |fileDrop|<<.from-version "5.2.0">> Optional. When set to "yes" allows dropping or pasting images into the editor to import them. Defaults to "no"| - -! Notes - -One trap to be aware of is that the edit text widget //cannot be used// to edit a field of the tiddler that contains it. Each keypress results in the tiddler being re-rendered, which loses the cursor position within the text field. - -Instead, place the edit text widget in a [[template|TemplateTiddlers]] that references the tiddler you want to modify. - -For example, if you wanted the tiddler GettingStarted to edit the value of the "myconfig" field of the tiddler "AppSettings", you might do so by creating a separate tiddler "ChangeAppSettings" that contains the following: - -``` -<$edit-text tiddler="AppSettings" field="myconfig"/> -``` - -And reference the template in any other tiddler (e.g. GettingStarted) with `{{ChangeAppSettings}}`. - -This works when your use of the tiddler //is not// the AppSettings itself which would cause a recursion problem. In this latter case you have to save the fields to a temporary (or alternative) tiddler (sort of the reverse of above) like so: - -``` -<$edit-text tiddler="StoreAppSettings" field="myconfig"/> -``` - -In short the EditTextWidget //can not// change properties of the tiddler it is embedded in or part of. It can only change fields of //other// tiddlers. One could use ShadowTiddlers to accomplish the field storage if needed.