inline editing, hitting enter to submit

inline editing, hitting enter to submit

rf1234rf1234 Posts: 2,991Questions: 87Answers: 421

Just found out that you can't use a select field in inline editing any longer if you want to submit by hitting enter. In that case the dropdown opens and nothing is submitted to the server. With the latest Editor version you can only use "onBlur" for submission - or you can't use select fields any longer.

To me this looks like a bug. If I recall it correctly this used to work with previous Editor versions. The example below has submission "onBlur", but you can still see the behavior of the select field hitting enter.

Is there any fix intended for this?

https://editor.datatables.net/examples/inline-editing/join.html

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Answer ✓

    Actually it only ever worked in Chrome (I think I'm right in saying that, its been a while!). This issue was the reason for the canReturnSubmit extension method for the Editor field plug-ins.

    It was never reliable to submit on return in a select input since the different browsers all did different things. One for example would actually select the item shown (if you were selecting by keyboard) and immediately submit it. Since there is no DOM API to determine if the select is open or not, there is simply no way to determine if it should be just selected or submitted. It was even worse when considering multi-select inputs.

    I agree that this seems like a backwards step, unfortunately, I just couldn't see a suitable resolution. The only suggestion I really have is to use Select2 or similar instead.

    Allan

  • rf1234rf1234 Posts: 2,991Questions: 87Answers: 421

    wasn't aware of that, Allan. Tried with selectize but it didn't work either. I can live with "onBlur" on this one page.

This discussion has been closed.