@bytebrand/fe-ui-core 4.2.173 → 4.2.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.2.173",
3
+ "version": "4.2.175",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -1,4 +1,5 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect, useMemo } from 'react';
2
+ import debounce from 'lodash/debounce';
2
3
  import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
4
  import { Slider } from '@mui/material';
4
5
  import { isMobileOnly } from 'react-device-detect';
@@ -53,6 +54,9 @@ const Range: React.FC<IRangeProps> = ({
53
54
  onChange(event, value)
54
55
  }
55
56
 
57
+ // Debounced onChange event handler
58
+ const debouncedOnChange = useMemo(() => debounce(onChangeRange, 0), [onChangeRange]);
59
+
56
60
  const formttedValue = (value: number) => {
57
61
  return (
58
62
  <>
@@ -71,7 +75,7 @@ const Range: React.FC<IRangeProps> = ({
71
75
  valueLabelDisplay='auto'
72
76
  valueLabelFormat={formttedValue}
73
77
  value={rangeValue}
74
- onChange={onChangeRange}
78
+ onChange={debouncedOnChange}
75
79
  sx={{
76
80
  color: '#005CCB'
77
81
  }}