Skip to content

Commit cf62070

Browse files
committed
fix: Fix ephemeral focus being taken twice.
1 parent d5eb18f commit cf62070

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/field-angle/src/field_angle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@ export class FieldAngle extends Blockly.FieldNumber {
206206
// eslint-disable-next-line @typescript-eslint/naming-convention
207207
protected override showEditor_(e?: Event) {
208208
// Mobile browsers have issues with in-line textareas (focus & keyboards).
209+
// Also, don't let the parent take ephemeral focus since the drop-down div
210+
// below will handle it, instead.
209211
const noFocus =
210212
Blockly.utils.userAgent.MOBILE ||
211213
Blockly.utils.userAgent.ANDROID ||
212214
Blockly.utils.userAgent.IPAD;
213-
super.showEditor_(e, noFocus);
215+
super.showEditor_(e, noFocus, false);
214216

215217
const editor = this.dropdownCreate();
216218
Blockly.DropDownDiv.getContentDiv().appendChild(editor);

plugins/field-slider/src/field_slider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ export class FieldSlider extends Blockly.FieldNumber {
102102
protected showEditor_(e?: Event, quietInput?: boolean) {
103103
// Always quiet the input for the super constructor, as we don't want to
104104
// focus on the text field, and we don't want to display the modal
105-
// editor on mobile devices.
106-
super.showEditor_(e, true);
105+
// editor on mobile devices. Also, don't let the parent take ephemeral focus
106+
// since the drop-down div below will handle it, instead.
107+
super.showEditor_(e, true, false);
107108

108109
// Build the DOM.
109110
const editor = this.dropdownCreate_();

0 commit comments

Comments
 (0)