Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    13
    Vote Rating
    0
    fullinet is on a distinguished road

      0  

    Exclamation DatePicker does't correctly show selected item while navigate with the shortcut keys

    DatePicker does't correctly show selected item while navigate with the shortcut keys


    - Detailed description of the problem
    In the DatePicker while navigating the days with the shortcuts keys the current selected day isn't show with the "x-date-selected" style, although the navigation is working fine.
    You can test it in the Birthday DateField the Forms example in the "Explorer Demo" ( http://www.sencha.com/examples/explorer.html#forms )

    This was correctly working on GXT 2.2.0 (and maybe later too).

    - Possible solutions
    I think this bug started when was changed this line of the update(DateWrapper date) method on DatePicker class from:
    Code:
    long sel = date != null ? date.clearTime().getTime() : 0;
    to (line 1041):
    Code:
    long sel = value != null ? value.resetTime().getTime() : Long.MIN_VALUE;
    So one possible working solution is change that line for:
    Code:
    long sel = date != null ? date.resetTime().getTime() : Long.MIN_VALUE;
    but i don't know if it break something that i didn't take into account

    Another possible working solution is change a if condition on the setCellStyle(Element cell, Date d, long sel, long min, long max) on DatePicker class (line 961) from:
    Code:
    if (t == sel) {
    to:
    Code:
    long tActiveDate = activeDate.getTime();
    if ((t == sel || t == tActiveDate) && (t != sel || sel == tActiveDate)) {
    - GXT version
    GXT 2.2.5 - GWT 2.4.0

    - Host mode / web mode / both
    Both modes

    - Browser and version
    IE 8, Firefox 9.0.1, Chrome 17.0.963.12 (dev), Opera 11.60

    - Operating System
    Windows XP SP3

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    We would need to introduce another style to fix this. One style needs to show the currently selected value, the other the currently focused one. Just applying the selected style wont help us, as than it might show value X as selected, although its only keyboard selected.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    13
    Vote Rating
    0
    fullinet is on a distinguished road

      0  

    Default


    Could be "x-date-active-hover" style (the same style used on mouse over).

    Something like this block work when added on setCellStyle() (I don't know the ARIA related attributes, because that I omitted it):
    Code:
    long tActiveDate = activeDate.getTime();
    if(t == tActiveDate) {
     fly(cell).addStyleName("x-date-active-hover");
     // ARIA related code
    } else {
     fly(cell).removeStyleName("x-date-active-hover");
     // ARIA related code
    }
    The only downside is that when you move the active date with the keys and then you put the mouse over that item and then mouse out, it loses the "active" style but if you move again with the keys it starts from the last position.

    Also, could be more noticeable the "active" style (a personal opinion, that could be resolved through user CSS but would be nice that it be the default).

Thread Participants: 1

Tags for this Thread