Inline Editor Select2 Type Problem
Inline Editor Select2 Type Problem
ihuangmx
Posts: 26Questions: 9Answers: 1
in Bug reports
when I use select2 type in inline editor, when i select and click the 'Enter' key, and submit not work , I only can use the Inline editing with a submit button mode
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Editor (since 1.6) has a
canReturnSubmit
method that plug-ins can tell Editor if the return key will submit or not. You could add:to the plug-in to allow it to submit.
Allan
@allan
I found that when I select a item, the focus is lose like that
and the source code 5143 the value of el is the body element not the input element,so i click the 'Enter Key' , It doesn't work
normally the focus should not lost and the el should be input element
@allan the select2 type in create button or edit button also can't use 'enter' as a shortcut key to open or close dropdown list, I can only use mouse the open select2
the select2 demo can do this by 'enter' key, and will not lose the input focus
problem solved, the select2 4.0.3 can't focus the input when selecting a item, so the inline editor enter can't work, I use the 4.0.5 ,and it works, thank you
Can you please provide us some code for understanding more?
There is an issue with inline editing and Select2: to submit values you must press enter after you've selected an option but pressing enter on a focused Select2 item, reopens it.
At the moment (Select2 ver 4.10) i was able to solve the issue applying two changes (you must host the files though):
FIRST
On editor.select2.js, let canReturnSubmit return true; change
to
SECOND
On select2.full.js, comment self.open on keypress for KEYS.ENTER, change
to