Skip to content
Snippets Groups Projects
  • Daniel Calviño Sánchez's avatar
    cb93af66
    Ignore Enter key up event on menu button toggles · cb93af66
    Daniel Calviño Sánchez authored
    
    Like links, buttons generate a "click" event as well as the regular
    "keydown" and "keyup" events when pressing Enter. Due to this, if both
    the "click" and the "keyup" events are handled, when the menu is open
    and Enter is pressed in the toggle the menu is first hidden when the
    first event is handled, but then shown again when the second event is
    handled. To prevent that only the "click" event should be handled when
    the toggle is a button, like it is already done with links.
    
    Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
    cb93af66
    History
    Ignore Enter key up event on menu button toggles
    Daniel Calviño Sánchez authored
    
    Like links, buttons generate a "click" event as well as the regular
    "keydown" and "keyup" events when pressing Enter. Due to this, if both
    the "click" and the "keyup" events are handled, when the menu is open
    and Enter is pressed in the toggle the menu is first hidden when the
    first event is handled, but then shown again when the second event is
    handled. To prevent that only the "click" event should be handled when
    the toggle is a button, like it is already done with links.
    
    Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>