diff --git a/plugins/field-angle/src/field_angle.ts b/plugins/field-angle/src/field_angle.ts index 088bbf35cc..31d7044ed6 100644 --- a/plugins/field-angle/src/field_angle.ts +++ b/plugins/field-angle/src/field_angle.ts @@ -206,11 +206,13 @@ export class FieldAngle extends Blockly.FieldNumber { // eslint-disable-next-line @typescript-eslint/naming-convention protected override showEditor_(e?: Event) { // Mobile browsers have issues with in-line textareas (focus & keyboards). + // Also, don't let the parent take ephemeral focus since the drop-down div + // below will handle it, instead. const noFocus = Blockly.utils.userAgent.MOBILE || Blockly.utils.userAgent.ANDROID || Blockly.utils.userAgent.IPAD; - super.showEditor_(e, noFocus); + super.showEditor_(e, noFocus, false); const editor = this.dropdownCreate(); Blockly.DropDownDiv.getContentDiv().appendChild(editor); diff --git a/plugins/field-slider/src/field_slider.ts b/plugins/field-slider/src/field_slider.ts index 045e7a6a92..64248e8425 100644 --- a/plugins/field-slider/src/field_slider.ts +++ b/plugins/field-slider/src/field_slider.ts @@ -102,8 +102,9 @@ export class FieldSlider extends Blockly.FieldNumber { protected showEditor_(e?: Event, quietInput?: boolean) { // Always quiet the input for the super constructor, as we don't want to // focus on the text field, and we don't want to display the modal - // editor on mobile devices. - super.showEditor_(e, true); + // editor on mobile devices. Also, don't let the parent take ephemeral focus + // since the drop-down div below will handle it, instead. + super.showEditor_(e, true, false); // Build the DOM. const editor = this.dropdownCreate_();