{"record":{"id":"c423ad0670a7bc35","repo":"Semantic-Org/Semantic-UI","slug":"value-specified-is-below-0","errorCode":null,"errorMessage":"Value specified is below 0%","messagePattern":"Value specified is below 0%","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/modules/progress.js","lineNumber":893,"sourceCode":"  value          : false,\n\n  // delay in ms for fail safe animation callback\n  failSafeDelay : 100,\n\n  onLabelUpdate : function(state, text, value, total){\n    return text;\n  },\n  onChange      : function(percent, value, total){},\n  onSuccess     : function(total){},\n  onActive      : function(value, total){},\n  onError       : function(value, total){},\n  onWarning     : function(value, total){},\n\n  error    : {\n    method     : 'The method you called is not defined.',\n    nonNumeric : 'Progress value is non numeric',\n    tooHigh    : 'Value specified is above 100%',\n    tooLow     : 'Value specified is below 0%'\n  },\n\n  regExp: {\n    variable: /\\{\\$*[A-z0-9]+\\}/g\n  },\n\n  metadata: {\n    percent : 'percent',\n    total   : 'total',\n    value   : 'value'\n  },\n\n  selector : {\n    bar      : '> .bar',\n    label    : '> .label',\n    progress : '.bar > .progress'\n  },\n","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/modules/progress.js#L875-L911","documentation":"Companion to [97]. In set.barWidth() (progress.js:405-407), if value < 0 the module logs error.tooLow and skips setting the width. Percentages below zero are invalid for the bar-width setter.","triggerScenarios":"Calling $('.progress').progress('set bar width', -10) or passing a negative number (e.g. from an overshooting decrement or a signed computation) to the barWidth setter.","commonSituations":"Decrement logic producing negatives; signed deltas; subtracting a larger from a smaller value without clamping; feeding raw sensor/counter differences that can be negative.","solutions":["Pass a non-negative percent to 'set bar width'.","Clamp with Math.max(0, value) before the call.","Use 'decrement'/'set progress' which normalize internally instead of feeding raw negatives."],"exampleFix":"// before\n$('.ui.progress').progress('set bar width', delta); // delta = -10 -> [98]\n\n// after\n$('.ui.progress').progress('set bar width', Math.max(0, delta));","handlingStrategy":"validation","validationCode":"var pct = Math.max(0, Math.min(100, Number(value)));\nif (Number(value) < 0) console.warn('barWidth clamped from', value);\n$('.ui.progress').progress('set bar width', pct);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass only non-negative percents to 'set bar width'.","Clamp deltas with Math.max(0, x).","Use 'decrement' which normalizes instead of raw negatives."],"tags":["progress","range","percent","semantic-ui","console-error"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}