From 8cf19651bc3d56ce51dc3cbd817b7b21a1840032 Mon Sep 17 00:00:00 2001 From: zepumph Date: Wed, 10 Nov 2021 11:00:54 -0700 Subject: [PATCH] add readingBlockContent to iconsBox in labelWithIconList, https://github.com/phetsims/scenery-phet/issues/711 --- js/keyboard/help/KeyboardHelpSection.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/keyboard/help/KeyboardHelpSection.js b/js/keyboard/help/KeyboardHelpSection.js index 0b0607410..639e481e1 100644 --- a/js/keyboard/help/KeyboardHelpSection.js +++ b/js/keyboard/help/KeyboardHelpSection.js @@ -267,7 +267,12 @@ class KeyboardHelpSection extends VBox { spacing: DEFAULT_VERTICAL_ICON_SPACING * 0.75, // less than the normal vertical icon spacing since it is a group align: 'left', tagName: 'li', - innerContent: labelInnerContent + innerContent: labelInnerContent, + + // voicing + // {string} - Content for this icon that is read by the Voicing feature + // when in a KeyboardHelpSection. If null, will default to the labelInnerContent. + readingBlockContent: null }, options.iconsVBoxOptions ); const labelText = new RichText( labelString, { font: LABEL_FONT } ); @@ -305,6 +310,9 @@ class KeyboardHelpSection extends VBox { const iconsBox = labelIconListGroup.createBox( iconsVBox, groupOptions ); // create the box to match height, but reference not necessary const labelWithHeightBox = labelIconListGroup.createBox( labelBox, groupOptions ); + // set the ReadingBlock content for the icon - default + iconsBox.readingBlockContent = options.iconsVBoxOptions.readingBlockContent || options.iconsVBoxOptions.innerContent; + return new HelpSectionRow( labelText, labelWithHeightBox, iconsBox ); }