Skip to content

Commit

Permalink
onStateChange in range widget
Browse files Browse the repository at this point in the history
  • Loading branch information
padawannn committed Jul 22, 2024
1 parent 48a293a commit a55a081
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/react-widgets/src/widgets/RangeWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ function RangeWidget({
[column, filters]
);

const customOnStateChange = ({ state, data }) => {
if (!onStateChange) return;
if (!data) return onStateChange({ state });
return onStateChange({
state,
data: {
values: data,
min,
max
}
});
};

const {
data = { min: undefined, max: undefined },
isLoading,
Expand All @@ -75,7 +88,7 @@ function RangeWidget({
},
global,
onError,
onStateChange,
onStateChange: customOnStateChange,
attemptRemoteCalculation: _hasFeatureFlag(_FeatureFlags.REMOTE_WIDGETS)
});

Expand Down

0 comments on commit a55a081

Please sign in to comment.