FlowFuse / node-red-dashboard

https://dashboard.flowfuse.com
Apache License 2.0
206 stars 49 forks source link

Dropdown - emit msg on event #1458

Open bartbutenaers opened 1 week ago

bartbutenaers commented 1 week ago

Description

This PR adds a new option to the ui-dropdown node to select when an output message should be triggered:

image

As explained in the info panel:

image

This msgTrigger property can also be dynamically set. The default value is "onChange" like in the previous versions, to avoid breaking changes.

The following example flow demonstrates the default "onChange" value, which is then dynamically overwritten by a "onClose" value:

dropdown_emit

Related Issue(s)

Closes 1457

Checklist

Labels

bartbutenaers commented 1 week ago

P.S. I used the @blur event, because @close was never triggered. See this discussion.

joepavitt commented 1 week ago

Thanks @bartbutenaers - great stuff.

Apart from a shift of where the form-row is in the config, and the labels used, this is good to go as far as I'm concerned. I'll be merging once the tests give me the green light.