Closed seb-jean closed 1 year ago
Personally I don't think it's really worth to add this additional complexity and syntax to the data-action
attribute. If you want a "match all characters" type of event listener you should just do data-action="keydown->menu#search"
and filter the thing you are looking for in the search()
method.
Using the keydown.[:alpha:]
syntax you'd anyway need to handle and fetch the value from something like event.detail.alpha
and do something with, which means you are writing custom logic anyway.
@marcoroth Yeah, I see what you mean.
Hi,
It would be interesting to add the possibility of putting a regex in the
keyMappings
. For instance:[:alpha:]
, to use any alphabetics character[:digit:]
, to use any digitsThen we could use it like this:
Tell me what you think about it.
Cheers 😁