mirror of
https://github.com/google/blockly.git
synced 2026-06-03 01:40:08 +02:00
fix(blocks): use static tooltip for controls_ifelse block (#9897)
The controls_ifelse block was using the controls_if_tooltip dynamic extension, which reads this.elseifCount_ and this.elseCount_ set by the controls_if_mutator. Since controls_ifelse has no mutator, both counts are undefined and the extension always returned TOOLTIP_1 (for a simple if), instead of TOOLTIP_2 (for if/else). The static tooltip already declared on the block was unreachable because of a typo (BKYCONTROLS_IF_TOOLTIP_2 was missing the underscore after BKY) and would have been overridden by the extension anyway. Fix the message key typo and drop the extension so the static TOOLTIP_2 string is displayed instead. Fixes #9813 Signed-off-by: sheitabrk <44614193+sheitabrk@users.noreply.github.com>
This commit is contained in:
@@ -100,10 +100,9 @@ export const blocks = createBlockDefinitionsFromJsonArray([
|
||||
'previousStatement': null,
|
||||
'nextStatement': null,
|
||||
'style': 'logic_blocks',
|
||||
'tooltip': '%{BKYCONTROLS_IF_TOOLTIP_2}',
|
||||
'tooltip': '%{BKY_CONTROLS_IF_TOOLTIP_2}',
|
||||
'helpUrl': '%{BKY_CONTROLS_IF_HELPURL}',
|
||||
'suppressPrefixSuffix': true,
|
||||
'extensions': ['controls_if_tooltip'],
|
||||
},
|
||||
// Block for comparison operator.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user