GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: fix bug that caused the number/string input in the custom block … · scratchfoundation/scratch-blocks@c3ee958

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/fields
    • field_textinput_removable.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/fields/field_textinput_removable.js‎

Copy file name to clipboardExpand all lines: src/fields/field_textinput_removable.js
+20-17Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,29 @@ import * as Blockly from "blockly/core";
4040
export class FieldTextInputRemovable extends Blockly.FieldTextInput {
4141
/**
4242
* Show the inline free-text editor on top of the text with the remove button.
43-
* @private
4443
*/
4544
showEditor_() {
46-
super.showEditor_();
45+
// Wait for our parent block to render so we can examine its metrics to
46+
// calculate rounded corners on the editor as needed.
47+
Blockly.renderManagement.finishQueuedRenders().then(() => {
48+
super.showEditor_();
4749

48-
const div = Blockly.WidgetDiv.getDiv();
49-
div.className += " removableTextInput";
50-
const removeButton = document.createElement("img");
51-
removeButton.className = "blocklyTextRemoveIcon";
52-
removeButton.setAttribute(
53-
"src",
54-
this.sourceBlock_.workspace.options.pathToMedia + "icons/remove.svg"
55-
);
56-
this.removeButtonMouseWrapper_ = Blockly.browserEvents.bind(
57-
removeButton,
58-
"mousedown",
59-
this,
60-
this.removeCallback_
61-
);
62-
div.appendChild(removeButton);
50+
const div = Blockly.WidgetDiv.getDiv();
51+
div.className += " removableTextInput";
52+
const removeButton = document.createElement("img");
53+
removeButton.className = "blocklyTextRemoveIcon";
54+
removeButton.setAttribute(
55+
"src",
56+
this.sourceBlock_.workspace.options.pathToMedia + "icons/remove.svg"
57+
);
58+
this.removeButtonMouseWrapper_ = Blockly.browserEvents.bind(
59+
removeButton,
60+
"mousedown",
61+
this,
62+
this.removeCallback_
63+
);
64+
div.appendChild(removeButton);
65+
});
6366
}
6467

6568
/**

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.