Selectr icon indicating copy to clipboard operation
Selectr copied to clipboard

Mobile Maximum call stack size exceeded

Open zmarcoempsol opened this issue 5 years ago • 6 comments

Hello, if used in mobile device ( also in browser ispector ) we have problem with add method to add options in the selectr

It seems that the change event keeps being called until a fatal error this.el.dispatchEvent(new Event("change"))

You can check the problem also in the official demo

Can you help please?

Thanks

Marco

cattura

zmarcoempsol avatar Oct 16 '18 16:10 zmarcoempsol

I'll look into this.

Mobius1 avatar Oct 23 '18 16:10 Mobius1

I have the same problem. The "change" event fires 43 times. "NativeDropdown: false" does not solve the problem. Selectr 2.4.4, 2.4.6

Stibium51 avatar Nov 21 '18 12:11 Stibium51

The entire codebase is a mess and needs refactoring.

Mobius1 avatar Nov 21 '18 14:11 Mobius1

hi, a solution for this?

mirkopulvirenti avatar Nov 26 '18 11:11 mirkopulvirenti

Hi, do we have a solution?

zaguiini avatar Dec 27 '18 14:12 zaguiini

Here is the quick fix for this bug. Put it somewhere in your code before you start using Selectr. also nativeDropdown should be set to false

Object.defineProperty(Selectr.prototype, 'mobileDevice', {
    get() { return false; },
    set() {},
    enumerable: true,
    configurable: true
});

Ke1R0 avatar Mar 29 '19 09:03 Ke1R0