Fix #10648 (add layer to the selected group)