Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Style/Colour of Inherited disabled block has unexpected behaviour #3530

Closed
radovan76 opened this issue Jan 2, 2020 · 1 comment
Closed
Assignees
Labels
component: themes issue: bug Describes why the code or behaviour is wrong

Comments

@radovan76
Copy link

When you change style or colour of block which is child of disabled block (getInheritedDisabled() of child block is true), colour of block is changed wrongly.

Steps to reproduce the behavior:

  1. Create top block
  2. Create child block
  3. Disable top block (child block will be disabled because childBlock.getInheritedDisabled()==true)
  4. Change style of child block
  5. Child block looks like shadow block

Expected behavior:

  1. Child block still looks like disabled block

Additional context:

Change code in block_svg.js:

Blockly.BlockSvg.prototype.updateColour = function() {
  if (!this.isEnabled()) {
    // Disabled blocks don't have colour.
    return;
  } 

to:

Blockly.BlockSvg.prototype.updateColour = function() {
  if (!this.isEnabled() || this.getInheritedDisabled()) {
    // Disabled blocks don't have colour.
    return;
  }
@radovan76 radovan76 added issue: triage Issues awaiting triage by a Blockly team member issue: bug Describes why the code or behaviour is wrong labels Jan 2, 2020
@moniika moniika added this to the 2019_q4_release milestone Jan 6, 2020
@moniika moniika removed the issue: triage Issues awaiting triage by a Blockly team member label Jan 6, 2020
@alschmiedt
Copy link
Contributor

This should be fixed in develop by this line of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: themes issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

3 participants