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

timeoutDelay broken with v2.0.0 #359

Closed
rbclark opened this issue Nov 21, 2022 · 1 comment
Closed

timeoutDelay broken with v2.0.0 #359

rbclark opened this issue Nov 21, 2022 · 1 comment

Comments

@rbclark
Copy link

rbclark commented Nov 21, 2022

Describe the bug
With version 1.27.0 we were setting timeoutDelay to 0 in order to fix an issue when running slimSelect in tests where the test suite would click on an option before the animation was complete and we would end up in a state where the tests were unable to continue since the dropdown was still active even after click.

In 2.0.0 this no longer works for 2 reasons:

  1. timeoutDelay cannot be set to 0 any longer due to the code and 0 || 200 == 200. The original intent of timeoutDelay as far as I can tell was so that users could set it to a very low value or 0 to avoid timing issues Drop down doesn't collapse when tabbing quickly between controls. #122.
  2. When I do set the value to something very low like 1 the behavior is now very different. It now very quickly closes the dropdown on first expand. Subsequent expands work properly for some reason. The screengrab below reproduces the issue. In order to do this I am initializing with the following block:
    new SlimSelect({
      select: '#element',
      settings: {
        timeoutDelay: 1
      }
    });

All I really need is a way to let the test suite click through quickly while still closing the dropdown after click so if you have any other suggestions on how to achieve that I'd be happy to hear them.

Screenshots

Screen.Recording.2022-11-21.at.10.29.05.AM.mov
@brianvoe
Copy link
Owner

I think I understand your issue. One of the messy things about javascript is timing. I have setTimeouts in various locations in slim select to allow the css animation to complete before setting something like isOpen: false after a certain period of time. I would like to try to address these animation issues with javascript instead of css so that way i can more programmably set timeouts that would better adhere to settings of specific animation durations.

Unfortunately I will have to put this on the list of todos for now. But i will create an issue specifically tackling the animation stuff i talked about. If you think you have a quick fix for now until I make the necessary updates then please submit a pr and ill try to get to it soon. Thanks.

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

2 participants