[Freeipa-devel] [PATCH] 259 Combobox keyboard support
Endi Sukma Dewata
edewata at redhat.com
Sat Mar 2 19:38:36 UTC 2013
On 02/27/2013 06:54 AM, Petr Vobornik wrote:
> On 02/27/2013 01:50 AM, Endi Sukma Dewata wrote:
>> Looks good. The patch already provides improvements, so feel free to
>> push.
>>
>>> * when CB is non-editable, user can start typing, first character
>>> will open list, second will be entered into search input. Note: I
>>> wanted to copy the first char to the search box as well, but I did not
>>> figure out reliable method for converting keycode to char for non ASCII
>>> keyboard layouts
>>
>> Could we use keypress() for this instead of keydown()? See
>> http://api.jquery.com/keypress/. The keypress() should return the
>> actual character, whereas the keydown() would return the code of the
>> keyboard key so it wouldn't be able to distinguish between 'a' and
>> 'A', which is not what we want.
>
> Weird, I could bet that I tried it and it failed. Probably I did some
> stupid mistake.
>
> Anyway there are still limitations:
> 1) Firefox behaves differently than Chrome:
> * when keydown is prevented. FF raises keypress, Chrome doesn't
> * FF doesn't raise keypress for 'Š' (Czech character), Chrome does.
> (the input method is pressing 'shift', 'ˇ' and 's'.
> 2) what to do on paste? We can't use input nor change event for
> evaluating it - default is prevented.
>
> I'm inclined to leave it as is.
Yeah. We can revisit this another time. It's not a blocking issue.
> Mentioned cases can be tested in following fiddle:
> http://jsfiddle.net/vopet/aMynp/
>
>> Another minor thing, if the search box is in focus, you can use the
>> Up/Down arrow to go to the list. However, from the list you cannot
>> use the Up/Down arrow to go back to the search box, you'd have to use
>> the Tab key. It's not really a problem, but it's not that consistent.
> Up/Down keys are natural way of changing value of a list - this part
> seems OK to me. So Up/Down arrow in search box might the problem, but
> I consider it a feature - saves some strokes. Also, User can always
> use tab to switch between search box and list.
I'm OK with the Up/Down arrow in search box too, but if it's not
consistent people may think it's a bug. So I'd suggest we make it such
that you can use Up/Down to go back to the search box.
All of the above are minor. The patch itself is ACKed.
--
Endi S. Dewata
More information about the Freeipa-devel
mailing list