Skip to content

Problems #1

Description

@Grawl

Three options.

First: I just trying to run this script when it's loaded:

import getScrollbarWidth from 'get-scrollbar-width'
window.scrollbarWidth = getScrollbarWidth() // index.js:23 Uncaught TypeError: Cannot read property 'appendChild' of null

Second: I trying to run this script on jQuery.ready():

import getScrollbarWidth from 'get-scrollbar-width'
$(document).ready(() => {
	window.scrollbarWidth = getScrollbarWidth() // -200 on macOS when scrollbars is hidden until scroll
})

Third: I'm trying to run this script on default exported function:

import getScrollbarWidth from 'get-scrollbar-width'
export default () => {
	window.scrollbarWidth = getScrollbarWidth() // undefined
}

I'm not sure about last but first two must work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions