{"record":{"id":"6bb17a91c3809f1d","repo":"Dogfalo/materialize","slug":"nouislider-padding-option-is-only-supported-on","errorCode":null,"errorMessage":"noUiSlider: 'padding' option is only supported on linear sliders.","messagePattern":"noUiSlider: 'padding' option is only supported on linear sliders\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extras/noUiSlider/nouislider.js","lineNumber":637,"sourceCode":"        if ( !parsed.limit || parsed.handles < 2 ) {\n            throw new Error(\"noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.\");\n        }\n    }\n\n    function testPadding ( parsed, entry ) {\n\n        if ( !isNumeric(entry) ){\n            throw new Error(\"noUiSlider: 'padding' option must be numeric.\");\n        }\n\n        if ( entry === 0 ) {\n            return;\n        }\n\n        parsed.padding = parsed.spectrum.getMargin(entry);\n\n        if ( !parsed.padding ) {\n            throw new Error(\"noUiSlider: 'padding' option is only supported on linear sliders.\");\n        }\n\n        if ( parsed.padding < 0 ) {\n            throw new Error(\"noUiSlider: 'padding' option must be a positive number.\");\n        }\n\n        if ( parsed.padding >= 50 ) {\n            throw new Error(\"noUiSlider: 'padding' option must be less than half the range.\");\n        }\n    }\n\n    function testDirection ( parsed, entry ) {\n\n        // Set direction as a numerical value for easy parsing.\n        // Invert connection for RTL sliders, so that the proper\n        // handles get the connect/background classes.\n        switch ( entry ) {\n            case 'ltr':","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/Dogfalo/materialize/blob/824e78248b3de81e383445e76ffb04cc3264fe7d/extras/noUiSlider/nouislider.js#L619-L655","documentation":"Thrown by testPadding when Spectrum.getMargin returns false, i.e. the range has more than two points and is non-linear. padding is only defined on a single linear segment, so a stepped scale cannot honor it.","triggerScenarios":"range: { min: 0, '50%': 50, max: 100 } combined with padding: 10.","commonSituations":"Adding intermediate stops to the range while leaving a padding config in place, or reusing a config block across linear and non-linear sliders.","solutions":["Remove padding on non-linear ranges.","Use a linear range: { min, max } if padding is required.","Approximate the effect by adjusting min/max outward."],"exampleFix":"// before\nrange: { min: 0, '50%': 50, max: 100 }, padding: 10\n// after\nrange: { min: 0, max: 100 }, padding: 10","handlingStrategy":"validation","validationCode":"function isLinearRange(range) { return Object.keys(range).length === 2 && 'min' in range && 'max' in range; }\nif (opts.padding != null && !isLinearRange(opts.range)) {\n  throw new Error('padding requires a linear range ({ min, max } only)');\n}","typeGuard":null,"tryCatchPattern":"try { noUiSlider.create(el, opts); }\ncatch (e) { if (/padding' option is only supported on linear/.test(e.message)) { delete opts.padding; /* retry */ } else throw e; }","preventionTips":["Keep padding exclusive to linear-range sliders.","When you add an intermediate stop, drop padding (and margin/limit).","Adjust min/max outward to approximate padding on non-linear scales."],"tags":["config","validation","padding","linear-range"],"backgroundTag":null,"analyzedSha":"824e78248b3de81e383445e76ffb04cc3264fe7d","analyzedAt":"2026-08-13T04:14:22.506Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}