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

disable handleTouch doesn't work #220

Closed
amhofny opened this issue Mar 19, 2019 · 0 comments
Closed

disable handleTouch doesn't work #220

amhofny opened this issue Mar 19, 2019 · 0 comments

Comments

@amhofny
Copy link
Contributor

amhofny commented Mar 19, 2019

Describe the bug
Disabling handleTouch is not working, if you set to false, the default value true will always be used, and the same goes for injectBaseStyles.

To Reproduce
Just set handleTouch to false and check the result, a more appropriate way is to edit the test case "accepts custom settings", like below to include "handleTouch" and "injectBaseStyles", and then run tests:

 it("accepts custom settings", () => {
      const anchor = document.querySelector(".test-anchor");
      const drift = new Drift(anchor, { inlineOffsetX: 12, handleTouch: false,
                                        injectBaseStyles: false });

      const expectedConfig = defaultDriftConfig();
      expectedConfig.inlineOffsetX = 12;
      expectedConfig.handleTouch = false;
      expectedConfig.injectBaseStyles = false;

      expect(drift.settings).toEqual(expectedConfig);
    });

Expected behaviour
handleTouch and injectBaseStyles to remain false after initialization with custom options, and touch is disabled on mobile.

Information:

  • drift version: i am using master branch
amhofny added a commit to amhofny/drift that referenced this issue Mar 19, 2019
- edit test case "accepts custom settings" to test for handleTouch and injectBaseStyles when they are set to false
- edit code to check for key in options instead of normal ||
amhofny added a commit to amhofny/drift that referenced this issue Mar 19, 2019
amhofny added a commit to amhofny/drift that referenced this issue Apr 2, 2019
1- remove extra unnecessary comments
2- ensure that handleTouch and injectBaseStyles gets assigned a truthy value
3- remove dist/* from pull request
amhofny added a commit to amhofny/drift that referenced this issue Apr 2, 2019
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