File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/packages/frontend/jupyter Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,17 @@ export function create_key_handler(
119
119
const mode = frame_actions . store . get ( "mode" ) ;
120
120
if ( mode === "escape" ) {
121
121
const focused = $ ( ":focus" ) ;
122
- if ( focused . length > 0 && focused [ 0 ] . tagName != "DIV" ) {
122
+ if (
123
+ focused . length > 0 &&
124
+ ( focused [ 0 ] . tagName != "DIV" ||
125
+ focused [ 0 ] . className ?. includes ( "widget-readout" ) )
126
+ ) {
123
127
// Never use keyboard shortcuts when something is focused, e.g.,
124
128
// getting a password or using text input widget. However, the cell list DIV
125
129
// itself gets focused often, so we have to avoid that special case.
130
+ // An example with ipywidgets that the className case above covers:
131
+ // import ipywidgets as widgets; w = widgets.IntSlider(0,1,100); w
132
+ // Then put your cursor in the number to the right of the slider and hit backspace.
126
133
return ;
127
134
}
128
135
}
You can’t perform that action at this time.
0 commit comments