Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

chips: md-chip-remove and $event.stopPropagation() not working #8847

Closed
@HascourAdrien

Description

@HascourAdrien

Hello, actually working a lot with md-chip which i like pretty much. I encounter several problems. Most of time because the doc is not complete. This time I couldn't find a working solutions in any other place.

my code :

<button class="md-chip-remove"
    md-chip-remove
    ng-click="$event.stopPropagation(); ctrl.function($chip);">
    // ng-click="ctrl.function($chip, $event);">
    <md-icon md-svg-icon="md-close"></md-icon>
 </button>

I use sweetAlert when the user click on the close 'x' of a chip when he wants to remove it. He can click on cancel or confirm the suppression.
the problem is, $event.stopPropagation(); doesn't stop the propagation of the event and remove the md-chip in every cases. Even before the user can click on cancel or confirm.

The only thing I could do is to add again the removed chip to my list of chips if the user clicked on cancel. But that not something i ll be satisfied with.

we got :
md-on-add expression
An expression which will be called when a chip has been added.

md-on-remove expression
An expression which will be called when a chip has been removed.

But we got nothing that is called so we could stop the add or remove action.
something like : md-on-click boolean
which will do the action only when the boolean is true and will wait if it's false.
it's a kind of delay.

But all this wouldn't be necessary if we could stop the propagation on the remove :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions