Skip to content

Remove .active class on items when removed with the X from remove_button plugin #1216

Closed
@Trinitonn

Description

@Trinitonn

Hi,

Thank you for a great plugin!

I encountered a situation using the remove_button plugin. When you press the X-icon on a selected item it removes the item from the selected list, however it does not remove the .active class on this element.

Try this by:
Add multiple items
Click on one of them so it gets the .active class
Remove the active one by pressing the X-icon
Select another item in the already selected item list, so that one gets the .active class
Reselect the item you removed by using the X-icon

You will end up with two items which both are .active.

This is no bug, but the behavior is unexpected for me as an end user. For my case is just added a removeClass in the removeItem function like this:

if ($item.hasClass('active')) { idx = self.$activeItems.indexOf($item[0]); self.$activeItems.splice(idx, 1); $item.removeClass('active'); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions