This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 21
21
22
22
< link href ="../polymer/polymer.html " rel ="import ">
23
23
24
- < polymer-element name ="paper-focusable " attributes ="active focused disabled isToggle " tabindex ="0 " on-down ="{{_downAction}} " on-up ="{{_upAction}} " on-focus ="{{focusAction}} " on-blur ="{{blurAction}} ">
24
+ < polymer-element name ="paper-focusable " attributes ="active focused disabled isToggle " tabindex ="0 " on-down ="{{_downAction}} " on-up ="{{_upAction}} " on-focus ="{{focusAction}} " on-blur ="{{blurAction}} " on-contextmenu =" {{contextMenuAction}} " >
25
25
26
26
< script >
27
27
Polymer ( 'paper-focusable' , {
106
106
}
107
107
} ,
108
108
109
+ // Pulling up the context menu for an item should focus it; but we need to
110
+ // be careful about how we deal with down/up events surrounding context
111
+ // menus. The up event typically does not fire until the context menu
112
+ // closes: so we focus immediately.
113
+ //
114
+ // This fires _after_ downAction.
115
+ contextMenuAction : function ( e ) {
116
+ if ( this . disabled ) {
117
+ return ;
118
+ }
119
+ // Note that upAction may fire _again_ on the actual up event.
120
+ this . upAction ( e ) ;
121
+ this . focusAction ( ) ;
122
+ } ,
123
+
109
124
_upAction : function ( e ) {
110
125
if ( this . disabled ) {
111
126
return ;
You can’t perform that action at this time.
0 commit comments