Inline editor issue with canReturnOnSubmit for disabled fields

Inline editor issue with canReturnOnSubmit for disabled fields

sliekenssliekens Posts: 97Questions: 17Answers: 2
edited March 2017 in Bug reports

When the inline editor has formOptions.inline configured to submit the form on return, the return key doesn't submit fields with fields.type set to "readonly", or any field that has been disabled using the disable.

Uncaught TypeError: Cannot read property 'canReturnSubmit' of null

My first impression is that Editor tries to read property canReturnSubmit of the current field, which is null because disabled fields can't have focus.

I suggest that the inline Editor should always call close when the return key is pressed on a disabled field, regardless of the form options.

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Thanks for letting me know about this - I'll put in a condition for this.

    The problem with the return key being pressed on a disabled field, as you state is that they can't have focus. Thus the return key can't really be pressed on them. Also if they could, simply calling close() would probably not be the right thing to do since it might be that unsaved changes are discarded.

    Allan

  • sliekenssliekens Posts: 97Questions: 17Answers: 2

    I think discarding changes is always the right thing to do if the field is disabled and the user expresses intent to leave the Editor by pressing the Return key. Why care about unsaved changes? I can only imagine one reason to disable a field: do not let anyone change it.

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Because I know some users don't like that. I don't disagree that your view point is perfectly valid, but I don't what Editor to have that as the only option. Some users want everything to be saved (unless the esc key is pressed for example). That should be up to them in my opinion.

    Allan

This discussion has been closed.