Author Topic: select option from list by enter keypress  (Read 4893 times)

ivitokhin

  • Newbie
  • *
  • Posts: 2
    • View Profile
select option from list by enter keypress
« on: October 25, 2019, 07:57:22 pm »
Hi, to all!
Could anybody help me? I use free edition.
Is it normal behaivor that option value in select list not selectable by Enter keypress?
Test case:
1) click left mouse button by cell with editor type :'select'
2) press space to expand options list
3) select option value by arrows (down,up) and press enter
result:
The cell is not populated with a value.
In all demo examples it works like this, but is it correct?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: select option from list by enter keypress
« Reply #1 on: October 30, 2019, 01:52:27 pm »
Editor is populated with the selected value upon Enter keypress and cell value changes when editor loses focus by tab or another Enter key.

This is normal behaviour. Please let know if you have better suggestion.

ivitokhin

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: select option from list by enter keypress
« Reply #2 on: October 31, 2019, 12:52:50 am »
Editor is populated with the selected value upon Enter keypress and cell value changes when editor loses focus by tab or another Enter key.

This is normal behaviour. Please let know if you have better suggestion.

Hello, paramvir!
Thank you for reply and for your project! Its really great.
Sorry, my English is not so well, may be.
I forgot to specify that this behaivor reproduce only in IE (11 in my case).
You can see the video below:
https://yadi.sk/i/mQJC9t9Q-Kb_EA
sequence again:
1. click to control by left mouse button;
2. press space to expand dropdown
3. select value by arrows and press enter

I'm only begginer in JS and not so good in it. But i found next way to fix it. I think its bad coding, but it helps me:

in pqgrid.min.js:
Code: [Select]
h.saveEditCell=function(a){
if(a.evt.type=='keydown' && a.evt.keyCode ==13 && a.evt.target instanceof HTMLSelectElement) {
a.evt.target.blur();
a.evt.target.focus();
}
var d=this.options,b=d.editModel;if(!b.indices)
...
« Last Edit: October 31, 2019, 12:56:48 am by ivitokhin »