Skip to content

Commit 1bbf028

Browse files
committed
Group delete added.
1 parent eba72f0 commit 1bbf028

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

projects/angular-editor-fabric-js/src/lib/angular-editor-fabric-js.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ export class FabricjsEditorComponent implements AfterViewInit {
502502

503503

504504
removeSelected() {
505-
const activeObject = this.canvas.getActiveObject();
506-
const activeGroup = this.canvas.getActiveObjects();
505+
const activeObject:any = this.canvas.getActiveObject();
506+
const activeGroup:any = this.canvas.getActiveObjects();
507507

508-
if (activeObject) {
508+
if (activeObject && !activeObject._objects) {
509509
this.canvas.remove(activeObject);
510510
// this.textString = '';
511511
} else if (activeGroup) {

src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ <h4>Github: <a href="https://github.com/saqib92/angular-editor-fabric-js">angula
146146
<div class="card-header">Options</div>
147147
<div class="card-body text-center">
148148
<div class="btn-group" role="group" aria-label="...">
149-
<button data-toggle="tooltip" data-placement="bottom" title="Delete element" type="button" class="btn btn-outline-danger" [disabled]="!canvas.selected"
149+
<button data-toggle="tooltip" data-placement="bottom" title="Delete element" type="button" class="btn btn-outline-danger"
150150
(click)="removeSelected();">
151151
<i class="fa fa-trash" aria-hidden="true"></i>
152152
</button>

0 commit comments

Comments
 (0)