LocalStorageCommandHandler.js Conflict with group function

I am using LocalStorageCommandHandler.js to achieve cross-page copying。
But I found that it affects grouping。
After adding: myDiagram.commandHandler = new LocalStorageCommandHandler();
o.diagram.commandHandler.canGroupSelection() always return false。

sorry for my poor english,Translated by Google

If you don’t replace the standard CommandHandler with the LocalStorageCommandHandler from the extensions directory, I bet you will still notice that CommandHandler.canGroupSelection always returns false. That is because the LocalStorageCommandHandler has nothing to do with groups.

Check the documentation for CommandHandler | GoJS API and see if any of its requirements to return true are not being met.

@walter I have tried many times, it’s not worked.
Here is an example in jsfiddle
https://jsfiddle.net/dxxzst/vj23yuoz/

It originated from https://gojs.net/latest/samples/basic.html

After adding: myDiagram.commandHandler = new LocalStorageCommandHandler();
Group menu will disappear
Ungroup still work

When I make a copy of the samples/basic.html sample and add loading the script:

<script src="../extensions/LocalStorageCommandHandler.js"></script>

and add this initialization at the beginning of the Diagram initializers:

          commandHandler: new LocalStorageCommandHandler(),

I find that the user can still group and ungroup, and myDiagram.commandHandler.canGroupSelection() returns true.

In looking at your code in your fiddle, I see your error: you replaced the Diagram.commandHandler after initializing the standard CommandHandler. So your final CommandHandler instance doesn’t have the needed initializations.

Works,Thank you for your help.