question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create Doesn't Render

See original GitHub issue

I have installed both nouislider and @types/nouislider into my project using:

npm install --save-dev nouislider
npm install --save-dev @types/nouislider

I have a <div> at the top of my page for the noUiSlider

<div class="noUiSlider" id="slider"></div>

Since I’m using webpack I also added the following to plugins within the webpack.config.js file:

new webpack.ProvidePlugin({
     noUiSlider: 'nouislider'
})

Within the TypeScript file, I use the import

import * as noUiSlider from 'nouislider';

And within the $(document).ready(function() {} function, I create the noUiSlider with

var slider = document.getElementById('slider');

if (slider) {
    noUiSlider.create(slider, {
        start: [20, 80],
        connect: true,
        range: {
            'min': 0,
            'max': 100
        }
    });
} 

Nothing is displayed within the HTML, however when I inspect the element I get

<div id="slider" class="noUiSlider noUi-target noUi-ltr noUi-horizontal">
    <div class="noUi-base">
        <div class="noUi-connects">
            <div class="noUi-connect" style="transform: translate(20%, 0px) scale(0.6, 1);"></div>
        </div>
        <div class="noUi-origin" style="transform: translate(20%, 0px); z-index: 5;">
            <div class="noUi-handle noUi-handle-lower" data-handle="0" tabindex="0" role="slider" aria-orientation="horizontal" aria-valuemin="0.0" aria-valuemax="80.0" aria-valuenow="20.0" aria-valuetext="20.00"></div>
        </div>
        <div class="noUi-origin" style="transform: translate(80%, 0px); z-index: 4;">
            <div class="noUi-handle noUi-handle-upper" data-handle="1" tabindex="0" role="slider" aria-orientation="horizontal" aria-valuemin="20.0" aria-valuemax="100.0" aria-valuenow="80.0" aria-valuetext="80.00"></div>
        </div>
    </div>
</div>

What would be causing the element to not appear correctly?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
leongersencommented, Jan 18, 2018

Is the CSS included?

0reactions
github-actions[bot]commented, May 25, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create React App build doesn't render all elements [closed]
Issue. I seems you've set the opacity to a really low value and the questions div is nearly invisible. #questions.visible { left: 0; ......
Read more >
ReactDOM does not render the app after build and only on ...
The problem is that when I try to serve the build folder, the first time I try to load the app in the...
Read more >
REACT – Simple Intro Component Not Rendering?
There are two main ways to use React. First, install and set it up locally, probably through create-react-app . Second, through a CDN....
Read more >
React's render() Doesn't... Render - DEV Community ‍ ‍
Just to be clear, rerender in this context means calling render for all components, it doesn't mean React will unmount and remount them....
Read more >
ReactDOM – React
render () controls the contents of the container node you pass in. Any existing DOM elements inside are replaced when first called. Later...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found