From 1eda21318459b4762c732c5c0d9b29de3e405b75 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Tue, 5 Jan 2021 16:52:53 +0100 Subject: [PATCH] Set onComplete handler as optional in Range cell component (#27987) Range cell component is used in multiple components but not all of them require the onComplete handler so it should be optional. --- .../components/src/mobile/bottom-sheet/range-cell.native.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/src/mobile/bottom-sheet/range-cell.native.js b/packages/components/src/mobile/bottom-sheet/range-cell.native.js index f041b2969fea3..a5fe31431245f 100644 --- a/packages/components/src/mobile/bottom-sheet/range-cell.native.js +++ b/packages/components/src/mobile/bottom-sheet/range-cell.native.js @@ -71,7 +71,9 @@ class BottomSheetRangeCell extends Component { sliderValue: nextValue, } ); onChange( nextValue ); - onComplete( nextValue ); + if ( onComplete ) { + onComplete( nextValue ); + } } render() {