Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Fixed flickering issue on Android when opening bottom sheet (both basic and custom render types).
- Improved backdrop animation with smooth fade-in/fade-out transitions.
- Fixed bottomsheet issue to close when the trigger attribute changes.

## [5.3.0] - 2026-6-10

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bottom-sheet-native",
"widgetName": "BottomSheet",
"version": "5.3.1",
"version": "5.3.2",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,21 @@ describe("Bottom sheet", () => {

expect(component.toJSON()).toMatchSnapshot();
});

it("closes custom modal when triggerAttribute is set to false", () => {
const triggerAttribute = new EditableValueBuilder<boolean>().withValue(true).build();
const props = {
...defaultProps,
modalRendering: "custom" as const,
largeContent: <Text>Content</Text>,
triggerAttribute
};

const { rerender } = render(<BottomSheet {...props} />);

triggerAttribute.setValue(false);
rerender(<BottomSheet {...props} triggerAttribute={triggerAttribute} />);

expect(triggerAttribute.value).toBe(false);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement, ReactNode, useCallback, useRef, useState } from "react";
import { ReactElement, ReactNode, useCallback, useEffect, useRef, useState } from "react";
import { Modal, Pressable, useWindowDimensions } from "react-native";
import BottomSheet, {
BottomSheetBackdrop,
Expand Down Expand Up @@ -33,6 +33,12 @@ export const CustomModalSheet = (props: CustomModalSheetProps): ReactElement =>
bottomSheetRef.current?.close();
}, []);

useEffect(() => {
if (!externalOpen && mounted && didOpenRef.current) {
close();
}
}, [externalOpen, mounted, close]);

const handleModalShow = useCallback(() => {
setReady(true);
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,18 @@
}
);
}
}, [externalOpen]);

Check warning on line 79 in packages/pluggableWidgets/bottom-sheet-native/src/components/NativeBottomSheet.tsx

View workflow job for this annotation

GitHub Actions / Unit tests

React Hook useEffect has missing dependencies: 'props.itemsBasic', 'props.triggerAttribute', and 'props.useNative'. Either include them or remove the dependency array

const close = useCallback(() => {
bottomSheetRef.current?.close();
}, []);

useEffect(() => {
if (!externalOpen && mounted && didOpenRef.current) {
close();
}
}, [externalOpen, mounted, close]);

const handleChange = useCallback(
(index: number) => {
if (index === 0) {
Expand Down Expand Up @@ -128,14 +134,14 @@

const buttonContainerStyle = { ...props.styles.modalItems?.container } as ModalItemContainerStyle;

const getButtonStyle = () => {

Check warning on line 137 in packages/pluggableWidgets/bottom-sheet-native/src/components/NativeBottomSheet.tsx

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
if (props.useNative) {
return [nativeAndroidStyles.buttonContainer];
}
return [styles.buttonContainer, buttonContainerStyle];
};

const renderItem = (item: ItemsBasicType, index: number) => {

Check warning on line 144 in packages/pluggableWidgets/bottom-sheet-native/src/components/NativeBottomSheet.tsx

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
if (Platform.OS === "android" || !props.useNative) {
return (
<TouchableHighlight
Expand All @@ -162,7 +168,7 @@
);
};

const getContainerStyle = () => {

Check warning on line 171 in packages/pluggableWidgets/bottom-sheet-native/src/components/NativeBottomSheet.tsx

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
if (props.useNative) {
return [nativeAndroidStyles.sheetContainer];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="BottomSheet" version="5.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="BottomSheet" version="5.3.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="BottomSheet.xml" />
</widgetFiles>
Expand Down
Loading