fix!: change css class for disabled block pattern#8864
fix!: change css class for disabled block pattern#8864maribethb merged 1 commit intoRaspberryPiFoundation:rc/v12.0.0from
Conversation
BenHenning
left a comment
There was a problem hiding this comment.
The solution makes sense! I'm not 100% keen on the blocklyDisabled vs. blocklyDisabledPattern naming (just adding 'pattern' doesn't add a lot of context), but I have no concerns with this PR since it's already an established name through the variable and existing code.
That being said, perhaps something like blocklyDisabledStyle would be clearer? It'd help to also rename blockDisabled to something like blocklyDisabledState to further distinguish, but that's presumably a much more impacting change than this.
I think |
2c05119
into
RaspberryPiFoundation:rc/v12.0.0
The basics
The details
Resolves
Fixes #8857
Proposed Changes
Moves the disabled pattern css into a separate class. The
blocklyDisabledclass doesn't contain any styling now by default.Reason for Changes
Not everyone wants to use the disabled pattern for their disabled blocks. They can't just skip adding the
blocklyDisabledclass because we use that for other things like adding other styles or not during a drag for example. Now if they don't want it, they can overrideupdateDisabled_in their custom path object and applyblocklyDisabledbut notblocklyDisabledPattern.Breaking Changes
If you do not override
PathObjectin a custom renderer, this change does not affect you and you do not need to take any action. This change only affects you if you overridePathObject.updateDisabled_and you do not callsuper.If you want the appearance of disabled blocks to remain the default, and you override this method, either call
superor be sure to add/remove theblocklyDisabledPatternas needed.If you do not want the appearance of blocks to remain the default, and you had previously overridden
updateDisabled_to ensure this, then you can continue to do so and be sure not to apply theblocklyDisabledPatternclass. Do apply theblocklyDisabledclass to continue getting other effects for disabled blocks like not showing the outline on when you hover a field on a disabled block.