mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Fixing Enter so it properly propogates to dropdown selection. (#934)
Fixing FieldSegment so it updates dropdowns when the underlying dropdown changes.
This commit is contained in:
@@ -70,7 +70,7 @@ blocklyApp.FieldSegmentComponent = ng.core.Component({
|
||||
this.notificationsService = notificationsService;
|
||||
this.dropdownOptions = [];
|
||||
}],
|
||||
ngOnInit: function() {
|
||||
ngDoCheck: function() {
|
||||
if (this.isDropdown()) {
|
||||
var rawOptions = this.mainField.getOptions_();
|
||||
this.dropdownOptions = rawOptions.map(function(valueAndText) {
|
||||
|
||||
@@ -484,8 +484,9 @@ blocklyApp.TreeService = ng.core.Class({
|
||||
// Return the focus to the workspace tree containing the input field.
|
||||
document.getElementById(treeId).focus();
|
||||
|
||||
// Note that Tab events are allowed to propagate through.
|
||||
if (e.keyCode == 27) {
|
||||
// Note that Tab and Enter events stop propagating, this behavior is
|
||||
// handled on other listeners.
|
||||
if (e.keyCode == 27 || e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user