[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 

Changeset 14496


Ignore:
Timestamp:
09/28/18 11:16:33 (6 months ago)
Author:
tbishop
Message:

cldrbug 11218: remove navigation keyboard shortcuts left/right arrow and backspace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/cldr-apps/WebContent/js/redesign.js

    r14125 r14496  
    5858    $('.tip-log').tooltip({placement:'bottom'}); 
    5959    $('body').keydown(function(event) { 
    60         if($(':focus').length === 0) { 
    61                 if(event.keyCode === 37) { 
    62                         chgPage(-1); 
    63                         event.preventDefault(); 
    64                 } else if (event.keyCode === 39) { 
    65                         chgPage(1); 
    66                         event.preventDefault(); 
    67                 } 
     60                /* 
     61                 * Some browsers (e.g., Firefox) treat Backspace (or Delete on macOS) as a shortcut for 
     62                 * going to the previous page in the browser's history. That's a problem when we have an 
     63                 * input window open for the user to type a new candidate item, especially if the window 
     64                 * is still visible but has lost focus. Prevent that behavior for backspace when the input 
     65                 * window has lost focus. Formerly, key codes 37 (left arrow) and 39 (right arrow) were used 
     66                 * here as shortcuts for chgPage(-1) and chgPage(1), respectively. However, that caused 
     67                 * problems similar to the problem with Backspace. Reference: https://unicode.org/cldr/trac/ticket/11218 
     68                 */ 
     69        if ($(':focus').length === 0) { 
     70            if (event.keyCode === 8) { // backspace 
     71                event.preventDefault(); 
     72            } 
    6873        } 
    6974    }) 
    70     //initFeedBack(); 
    7175}); 
    7276 
Note: See TracChangeset for help on using the changeset viewer.