cesanta / mongoose-wizard

1 stars 1 forks source link

When an action/button is placed on a panel which has a save button, clicking the 'save' button triggers the action. I believe the button should only be triggered if it is clicked or otherwise explicitly activated. #6

Closed cpq closed 2 months ago

cpq commented 2 months ago

@dvosully these two - an action button, and a save button, seem conflicting to me.. What would be an example of such setup?

dvosully commented 2 months ago

The situation I encountered it was: a panel to set the MQTT settings, with URL and authentication parameters, including user supplied certificate/key files to be uploaded. The user certificates could be deleted using an action button.

I was grouping settings into panels by functionality, thus had the certificate delete (action) and upload (file) on the same panel (with save enabled) as the URL set and other MQTT related parameters. The result of this arrangement was that clicking save on this panel would execute the action and delete the certificate.

I agree that save is conceptually conflicting with an action, this is why I didn't expect the save to trigger the action. My expectation was that an action would be executed only if the button is clicked, and would be ignored if save was executed on the panel.

It's easy enough to work around, split it into separate panels, but I found the behaviour unexpected enough to be worth mentioning.

cpq commented 2 months ago

Can't reproduce this one. I did the following steps:

  1. Made blank UI
  2. Created 1 action variable
  3. Created one panel with 1 "button" widget, attached to the action variable
image
  1. Generated UI, clicked on "save" button - and nothing happens, action is NOT triggered
  2. Clicked on the action button - action IS triggered.
  3. Added an input widget to the panel. Save works as expected, input is triggered but action is not.

@dvosully could you double-check and elaborate on a correct way to reproduce, please?

dvosully commented 2 months ago

You beat me to it by seconds. This appears to be resolved in the current version. Save does not trigger an action (any more).

cpq commented 2 months ago

Thanks David! I am closing this one then.