forest-rails icon indicating copy to clipboard operation
forest-rails copied to clipboard

Smart Action, unpredicted behaviour (?) field value

Open daniel-gato opened this issue 7 years ago • 2 comments

I don't know if this is normal behaviour, but if it is, maybe you should specify it on the doc. When you have a in your smart action and you submit the fields to the action, somethimes the field is blank, sometimes it submits no field.

Expected behaviour

Field value to be always blank or always not present. But not both.

## Actual behavior

not present case:

  1. Click on a smart action with fields button
  2. Opens the fields view
  3. Click on submit button

This gives us fields: { }

blank case:

  1. Click on a smart action with fields button
  2. Opens the fields part
  3. Click on the field
  4. Click outside the field
  5. Click on submit button

This gives us fields: { "name of field": "" }

Failure Logs

none

Context

not relevant, or if so, ask and I will provide.

daniel-gato avatar Dec 20 '17 08:12 daniel-gato

Hi @daniel-costa, thanks for the report. I think the expected behaviour is to always have the "not present" case in both usecases.

arnaudbesnier avatar Dec 20 '17 10:12 arnaudbesnier

I get it from the "rails" perspective. My concern is more in the UX logic. When does the user chooses it has to be sent and has to be blank? And if he is aware of it, how could he revert blank to nil.

For example, if it is established the rule "If you focus the field, then the value becomes it's content. Therefore an empty field will result in a blank field." . What about the user going to a field and using tab to go to the next ones. He might go in a field and set it to blank while he was trying to move trough the form.

Anyway, I thought you should be aware of the behaviour and maybe reference it somewhere in the documentation.

daniel-gato avatar Dec 22 '17 06:12 daniel-gato