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
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/bottom-sheet-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- Fixed bottomsheet issue to close when the trigger attribute changes.

## [5.0.5] - 2026-7-2

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bottom-sheet-native",
"widgetName": "BottomSheet",
"version": "5.0.5",
"version": "5.0.6",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,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 @@ -82,6 +82,12 @@ export const NativeBottomSheet = (props: NativeBottomSheetProps): ReactElement =
bottomSheetRef.current?.close();
}, []);

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

const handleChange = useCallback(
(index: number) => {
if (index === 0) {
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.0.5" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="BottomSheet" version="5.0.6" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="BottomSheet.xml" />
</widgetFiles>
Expand Down
Loading