Skip to content

Commit 0d98108

Browse files
authored
Merge pull request #2690 from zerline/focus-fix1
Fix focus() for Select.
2 parents 4fd70a7 + e5b74de commit 0d98108

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/controls/src/widget_selection.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ class DropdownView extends SelectionView {
165165
this.listbox.blur();
166166
}
167167
};
168-
169-
listbox: HTMLSelectElement;
170168
}
171169

172170

@@ -255,6 +253,17 @@ class SelectView extends SelectionView {
255253
this.model.set('index', this.listbox.selectedIndex, {updated_view: this});
256254
this.touch();
257255
}
256+
257+
/**
258+
* Handle message sent to the front end.
259+
*/
260+
handle_message(content: any) {
261+
if (content.do == 'focus') {
262+
this.listbox.focus();
263+
} else if (content.do == 'blur') {
264+
this.listbox.blur();
265+
}
266+
};
258267
}
259268

260269
export

0 commit comments

Comments
 (0)