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

Clear cache when toggling device emulation mode #2

Open
nhardy opened this issue Feb 12, 2020 · 1 comment
Open

Clear cache when toggling device emulation mode #2

nhardy opened this issue Feb 12, 2020 · 1 comment

Comments

@nhardy
Copy link

@nhardy nhardy commented Feb 12, 2020

Is your feature request related to a problem? Please describe.

Scroll bar width can change when toggling device emulation mode. (e.g. 17px to 0px, vice-versa)

Describe the solution you'd like

Listen to window resize events and automatically clear the cache, or provide a more clear interface to clear the cache (__cache feels too much like an internal that consumers shouldn't touch).

Describe alternatives you've considered

Consumers of the package requiring this functionality can listen to window resize events and manually delete scrollbarWidth.__cache;

@xobotyi

This comment has been minimized.

Copy link
Owner

@xobotyi xobotyi commented Feb 12, 2020

Actually it is intended to be set to undefined/deleted by consumers when they need sbw recalculation.

I'll clarify it in readme later.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.