[TW5] Request concerning the keyboard widget

67 views
Skip to first unread message

FrD

unread,
Mar 12, 2017, 5:24:12 AM3/12/17
to TiddlyWiki
Hi,

I've been working on my checklist plugin (site here), see this thread.
I've been following a suggestion by @Jon to use the keyboard when editing an item of the checklist.

I found the keyboard widget useful for that. But it creates a div and it's not looking pretty in the checklist.

To see it, go to the site, click on the tiddler "EditCheckboxMod" in the recent tiddlers, and check the checkbox. Then go to the example and edit an item. You can now user the "return" key to save the modification. But the elements of the checklist under the one that is edited are pushed down a bit too much because of the div created by the keyboard widget.

To correct that, in my own working file; I modified the keyboard widget to generate a "span" instead of a "div", and it works just fine.

So I was wondering whether the keyboard widget could be modified, and have a "tag" attribute to choose the html element that is created (just like the button widget for instance).

Regards

FrD

Eric Shulman

unread,
Mar 12, 2017, 6:45:18 AM3/12/17
to TiddlyWiki
On Sunday, March 12, 2017 at 1:24:12 AM UTC-8, FrD wrote:
I found the keyboard widget useful for that. But it creates a div and it's not looking pretty in the checklist.
...
 
To correct that, in my own working file; I modified the keyboard widget to generate a "span" instead of a "div", and it works just fine.

The <$keyboard> widget has an optional "class" param that can be applied to the DIV.  Thus, if you define a class:

.inline { display:inline; } 

You can then use

   <$keyboard class="inline" ...>

to suppress the extra line spacing.

enjoy,
-e
Eric Shulman
TiddlyTools - "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

FrD

unread,
Mar 12, 2017, 6:59:07 AM3/12/17
to TiddlyWiki
Hi Eric,

Always very happy to see you step in here on tiddlywiki topics !

Thanks a lot for your answer ; it does the trick as usual -:)


Regards

FrD

PMario

unread,
Mar 13, 2017, 3:19:32 AM3/13/17
to TiddlyWiki
On Sunday, March 12, 2017 at 10:24:12 AM UTC+1, FrD wrote:
So I was wondering whether the keyboard widget could be modified, and have a "tag" attribute to choose the html element that is created (just like the button widget for instance).

Hi,
Even if this thread seems to be solved, imo it would be worth a new feature request on github.
-m
Reply all
Reply to author
Forward
0 new messages