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 prevented modal dialogs from appearing on mobile (#… · scratchfoundation/scratch-blocks@37e0f10

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • data_category.js
    • procedures.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/data_category.js‎

Copy file name to clipboardExpand all lines: src/data_category.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,16 @@ function addCreateButton(xmlList, workspace, type) {
426426
}
427427
button.setAttribute("text", msg);
428428
button.setAttribute("callbackKey", callbackKey);
429-
workspace.registerButtonCallback(callbackKey, callback);
429+
workspace.registerButtonCallback(callbackKey, (b) => {
430+
// Run the callback after a delay to avoid it getting captured by the React
431+
// modal in scratch-gui and being registered as a click on the scrim that
432+
// dismisses the dialog.
433+
requestAnimationFrame(() => {
434+
setTimeout(() => {
435+
callback(b);
436+
});
437+
});
438+
});
430439
xmlList.push(button);
431440
}
432441

Collapse file

‎src/procedures.js‎

Copy file name to clipboardExpand all lines: src/procedures.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,14 @@ function addCreateButton_(workspace, xmlList) {
105105
var msg = Blockly.Msg.NEW_PROCEDURE;
106106
var callbackKey = "CREATE_PROCEDURE";
107107
var callback = function () {
108-
createProcedureDefCallback(workspace);
108+
// Run the callback after a delay to avoid it getting captured by the React
109+
// modal in scratch-gui and being registered as a click on the scrim that
110+
// dismisses the dialog.
111+
requestAnimationFrame(() => {
112+
setTimeout(() => {
113+
createProcedureDefCallback(workspace);
114+
});
115+
});
109116
};
110117
button.setAttribute("text", msg);
111118
button.setAttribute("callbackKey", callbackKey);

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.