Skip to content

unable to use name in dropdown with symbol + or () #26

@sandrocantagallo

Description

@sandrocantagallo

if you use in dropdown list a name that have symbol: + is impossible to selected it.
Same problem if you use symbol ( and )

The problem is in: node_modules/vue-simple-search-dropdown/dist/vue-simple-search-dropdown.js

Line: 165

for now i fix writing something like that:

var r = new RegExp(this.searchFilter.replace("+", "").replace("(", "").replace(")", ""), "ig");

But is just a workaround.

I also changed method selectOption:

methods: {
                    selectOption: function t(e) {
                        this.selected = e;
                        this.optionsShown = false;
                        this.searchFilter = this.selected.name;
                        //console.log(this.selected);
                        //console.log(this.searchFilter   );
                        //console.log(this.selected.name.replace("(", "").replace(")", ""));
                        this.selected.name = this.selected.name.replace("(", "").replace(")", "");
                        this.$emit("selected", this.selected);
                    },

In this way element don't show error and are selectable.

Please fix it.

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