Skip to content

Remove function issues #44

Open
@Jevedor

Description

@Jevedor

I am finding the remove functionality does not work properly.

As per the documentation this should remove the markup:

$(".container").customScrollbar("remove");

The issue is, it does not properly remove the added "overview" and "viewport" elements. Looking in the code the issue is the use of unwrap.

removeScrollbarComponents: function () {
this.removeScrollbar("vertical");
this.removeScrollbar("horizontal");
if (this.overviewAdded)
this.$element.unwrap();
if (this.viewPortAdded)
this.$element.unwrap();
},

unwrap removes what is wrapping the element not what the element is wrapping. Thus this function ends up removing elements above the container instead of removing viewport and overview elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions