Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select stops working randomly in Chrome in macOS #770

Open
voltuer opened this issue Feb 16, 2020 · 19 comments
Open

Select stops working randomly in Chrome in macOS #770

voltuer opened this issue Feb 16, 2020 · 19 comments

Comments

@voltuer
Copy link

voltuer commented Feb 16, 2020

latest macOS Catalina, latest Vuesax 3, latest NodeJS 12, latest Chrome (80), NPM

As this video shows, the Select component stops working out of nothing, I'm just unable to use it on Chrome. Just open the Select documentation page and play around clicking selectors and then clicking out side. Some times it works for a while and stops working, and some times it stops working at the first or second use.

https://youtu.be/LahMHi9WAuU

@ghost
Copy link

ghost commented Feb 18, 2020

Same issue here. I have to reload the page, or click 3/4 times to make it work.

@omarhen
Copy link

omarhen commented Feb 24, 2020

+1

@voltuer
Copy link
Author

voltuer commented Mar 2, 2020

Project is completely abandoned

@bradapeter
Copy link

+1

@ivangreve
Copy link

Same issue! +1

@ivangreve
Copy link

I found the error in the "event.target.closest" in vsSelect.vue , and I change this method for event.target.getElementsByClassName().
I wait for the merge!

    clickBlur(event) {
      //let closestx = event.target.closest(".vs-select--options");
      let closestx = event.target.getElementsByClassName(
        "vs-select--options"
      )[0];
      if (!closestx) {
        this.closeOptions();
        if (this.autocomplete) {
          this.filterItems("");
        }
        this.changeValue();
      }
    },

@voltuer
Copy link
Author

voltuer commented Mar 14, 2020

@ivangreve awesome!! I hope somebody merges it

@okrulik
Copy link

okrulik commented Mar 25, 2020

+1

@okrulik
Copy link

okrulik commented Mar 25, 2020

@ivangreve your patch have to be improved for cases if there are no options in select
event.target.getElementsByClassName(
"vs-select--options"
) -- this can be empty

@ivangreve
Copy link

Yes, you´re right. Now I'm using this piece of code

  let closestx;
  if (event.target == document.body) {
    closestx = event.target.getElementsByClassName("vs-select--options")[0];
  } else {
    closestx = event.target.closest(".vs-select--options");
  }

@okrulik
Copy link

okrulik commented Mar 26, 2020

@ivangreve more safe is
let closestx;
if (event.target == document.body) {
closestx = event.target.getElementsByClassName("vs-select--options").item(0);
} else {
closestx = event.target.closest(".vs-select--options");
}

also there is issue with this component where there are no options (vs-select-item) in it. when you click it it will looks strange have no idea how to fix it

@fbasar
Copy link

fbasar commented Mar 27, 2020

+1

@voltuer
Copy link
Author

voltuer commented Mar 27, 2020

I mailed the author a month ago with no answer so far, I hope he's ok

@okrulik
Copy link

okrulik commented Mar 27, 2020

I switched to vue-select as this one has so many issues

@fbasar
Copy link

fbasar commented Mar 30, 2020

I fixed this problem please use https://www.npmjs.com/package/fvuesax

@yusrenaltair
Copy link

I fixed this problem please use https://www.npmjs.com/package/fvuesax

Select working normally, but the table doesn't working at all.
Check these fiddle
Vuesax Original Source
Yours

@CaptainCannabis
Copy link

I fixed this problem please use https://www.npmjs.com/package/fvuesax

i can confirm that the vs-select of that repo is working. Only changed vs-select-component and kept vs-select-item and vs-select-group from vuesax 3.11.15.

You see any problems with that? @fbasar

miaulightouch added a commit to miaulightouch/vuesax that referenced this issue Jun 16, 2020
it's adopted from @okrulik 's comment in lusaxweb#770.
it should be considered a workaround, not a proper fix.

somehow, `clickBlur` method would randomly capture click event from \<body\>, closest method would always return null, make vsSelect open/close at the same time.
@lbatistela
Copy link

lbatistela commented Jun 25, 2020

This issue can be reproduced by clicking and holding on the vs-select for more than 100ms. On Chrome, the mouse button release fires the click event which in turn closes the options. On Firefox it works properly because the click event is not fired at this time. That's why it stops working randomly.

Changing mouse events from click to mousedown in vsSelect.vue worked out for me. Increasing setTimeout delay also works.

focus() {
  this.active = true;
  this.setLabelClass(this.$refs.inputSelectLabel, true);
  let inputx = this.$refs.inputselect;
  setTimeout(() => {
    // document.addEventListener("click", this.clickBlur);
    document.addEventListener("mousedown", this.clickBlur);
  }, 100);
  ...
}

@leoclo
Copy link

leoclo commented Jul 17, 2020

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants