Skip to content

Commit 1a2c3bd

Browse files
authored
Merge pull request scratchfoundation#4563 from paulkaplan/fix-tab-toolbox-refresh
Request a toolbox refresh after switching between tabs to fix scratchfoundation#4561
2 parents 9977ec6 + 0f803df commit 1a2c3bd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/containers/blocks.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class Blocks extends React.Component {
162162
this.setLocale();
163163
} else {
164164
this.props.vm.refreshWorkspace();
165+
this.requestToolboxUpdate();
165166
}
166167

167168
window.dispatchEvent(new Event('resize'));

test/integration/blocks.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,18 @@ describe('Working with the blocks', () => {
252252
await driver.sleep(500); // Wait for scroll to finish
253253
await clickText('my\u00A0variable');
254254
});
255+
256+
// Regression test for switching editor tabs causing toolbox to stop updating
257+
test('Creating variables after adding extensions updates the toolbox', async () => {
258+
await loadUri(uri);
259+
await clickText('Costumes');
260+
await clickText('Code');
261+
await clickText('Variables', scope.blocksTab);
262+
await driver.sleep(500); // Wait for scroll
263+
await clickText('Make a List');
264+
const el = await findByXpath("//input[@name='New list name:']");
265+
await el.sendKeys('list1');
266+
await clickButton('OK');
267+
await clickText('list1', scope.blocksTab);
268+
});
255269
});

0 commit comments

Comments
 (0)