@@ -18,6 +18,7 @@ const contentChangeEvents = [
1818 Blockly . Events . BLOCK_MOVE ,
1919 Blockly . Events . BLOCK_DELETE ,
2020 Blockly . Events . COMMENT_MOVE ,
21+ Blockly . Events . COMMENT_RESIZE ,
2122 Blockly . Events . COMMENT_CREATE ,
2223 Blockly . Events . COMMENT_DELETE ,
2324] ;
@@ -196,7 +197,9 @@ export class ContentHighlight {
196197 this . position ( this . cachedContentMetrics , absoluteMetrics ) ;
197198 }
198199 } else if ( event . type === Blockly . Events . BLOCK_DRAG ) {
199- this . handleBlockDrag ( event as Blockly . Events . BlockDrag ) ;
200+ this . handleDragEvent ( event as Blockly . Events . BlockDrag ) ;
201+ } else if ( event . type === Blockly . Events . COMMENT_DRAG ) {
202+ this . handleDragEvent ( event as Blockly . Events . CommentDrag ) ;
200203 } else if ( event . type === Blockly . Events . BLOCK_CHANGE ) {
201204 // Resizes the content highlight when it is a block change event
202205 const metricsManager = this . workspace . getMetricsManager ( ) ;
@@ -211,7 +214,9 @@ export class ContentHighlight {
211214 *
212215 * @param event The BlockDrag event.
213216 */
214- private handleBlockDrag ( event : Blockly . Events . BlockDrag ) {
217+ private handleDragEvent (
218+ event : Blockly . Events . BlockDrag | Blockly . Events . CommentDrag ,
219+ ) {
215220 const opacity = event . isStart ? '0' : '1' ;
216221 this . svgGroup ?. setAttribute ( 'opacity' , opacity ) ;
217222 }
0 commit comments