8000 Error when trashcan is used with maxTrashcanContents = 0 · Issue #5729 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error when trashcan is used with maxTrashcanContents = 0 #5729
Closed
@31piy

Description

@31piy

Describe the bug

There is an error in console when you configure the workspace with maxTrashcanContents set to 0 but trashcan is true or the toolbox has categories.

To Reproduce

  1. Set maxTrashcanContents to 0 and trashcan to true while configuring the workspace.
  2. Click on the trash icon

Expected behavior

Everything works fine but when the trashcan is clicked, an error is thrown which can be see in the console. Ideally, this error should not be thrown.

ERROR TypeError: Cannot read properties of null (reading 'isVisible')
    at Blockly.Trashcan.contentsIsOpen (blockly_compressed.js:998)
    at Blockly.Trashcan.blockMouseDownWhenOpenable_ (blockly_compressed.js:1006)
    at SVGGElement.e (blockly_compressed.js:58)
    at ZoneDelegate.invokeTask (zone.js:406)
    at Object.onInvokeTask (core.js:28679)
    at ZoneDelegate.invokeTask (zone.js:405)
    at Zone.runTask (zone.js:178)
    at ZoneTask.invokeTask [as invoke] (zone.js:487)
    at invokeTask (zone.js:1600)
    at SVGGElement.globalZoneAwareCallback (zone.js:1626)

Additional context
Seems like this line is the problem

return this.flyout.isVisible();

It assumes that this.flyout is always available, but it is null when maxTrashcanContents is 0.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0