TiddlyWiki5 icon indicating copy to clipboard operation
TiddlyWiki5 copied to clipboard

[IDEA] Allow access to element properties within $eventcatcher events

Open CodaCodr opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe.

<input type="text" value="saq" ...>

Typing "codacoder" into the above control, then reading dom-value in the $change handler returns "saq".

That's understandable and perfectly correct.

But, ideally, I want the value of the value property (not the attribute).

Could we add dom-prop-* for situations like this? Or, conflate/coerce dom-value to the property value? (I can't think of another attr/prop pairing where this is needed so I can't see a reason to deny the obvious benefit of a kludgy approach here. jQuery.val( ) springs to mind.)

Background I want to offer input filtering (list with hundreds of options - a <select> is terrible).  I therefore want to use a datalist.   I therefore need an HTML Input element.    I therefore need to do the tiddler-field binding myself.

But without being able to catch the value property, I'm sunk.

I could write a JavaScript getCurrentValue(), but it would be nice to fill this "gap" with a wikitext solution.

See talk thread: https://talk.tiddlywiki.org/t/eventcatcher-value-property/10299

( @saqimtiaz )

CodaCodr avatar Jul 30 '24 14:07 CodaCodr