Skip to content

Commit e3d1910

Browse files
authored
Merge pull request #364 from brainstormforce/staging
`v1.7.7`
2 parents dfe1134 + f242b18 commit e3d1910

8 files changed

Lines changed: 42 additions & 18 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Using Force UI as a dependency in package.json -
1414

1515
```json
1616
"dependencies": {
17-
"@bsf/force-ui": "git+https://github.com/brainstormforce/force-ui#1.7.6"
17+
"@bsf/force-ui": "git+https://github.com/brainstormforce/force-ui#1.7.7"
1818
}
1919
```
2020

@@ -28,7 +28,7 @@ npm install
2828
Or you can directly run the following command to install the package -
2929

3030
```bash
31-
npm i -S @bsf/force-ui@git+https://github.com/brainstormforce/force-ui.git#1.7.6
31+
npm i -S @bsf/force-ui@git+https://github.com/brainstormforce/force-ui.git#1.7.7
3232
```
3333

3434
<br />

changelog.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
Version 1.7.7 - 29th January, 2026
2+
- Fix: Organism - Dialog, Drawer: Resolved an issue where the component closed unexpectedly when `exitOnClickOutside` was enabled and a toaster was dismissed.
3+
14
Version 1.7.6 - 11th September, 2025
25
- Improvements: Atom - Select - Improved search logic.
36

4-
57
Version 1.7.5 - 25th August, 2025
68
- New: Template - UAE Dashboard
79
- New: Template - UAE Widgets

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bsf/force-ui",
3-
"version": "1.7.6",
3+
"version": "1.7.7",
44
"description": "Library of components for the BSF project",
55
"main": "./dist/force-ui.cjs.js",
66
"module": "./dist/force-ui.es.js",

src/components/dialog/dialog.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ const Dialog = ( {
119119
const dismiss = useDismiss( context, {
120120
enabled: exitOnClickOutside || exitOnEsc,
121121
escapeKey: exitOnEsc,
122-
outsidePress: exitOnClickOutside,
122+
outsidePress: ( event ) => {
123+
if ( ! exitOnClickOutside ) {
124+
return false;
125+
}
126+
const target = event?.target as HTMLElement;
127+
const isToastElement = target?.closest( 'ul.fui-toast-container' );
128+
return ! isToastElement;
129+
},
123130
} );
124131
const role = useRole( context, { role: 'dialog' } );
125132

src/components/drawer/drawer.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ import React, {
1010
type ReactNode,
1111
} from 'react';
1212
import { callAll } from '@/utilities/functions';
13-
import { useFloating, useInteractions, useClick, useRole, useDismiss, type FloatingContext, type UseFloatingReturn } from '@floating-ui/react';
13+
import {
14+
useFloating,
15+
useInteractions,
16+
useClick,
17+
useRole,
18+
useDismiss,
19+
type FloatingContext,
20+
type UseFloatingReturn,
21+
} from '@floating-ui/react';
1422
import DrawerPanel from './drawer-panel';
1523
import DrawerHeader from './drawer-header';
1624
import DrawerTitle from './drawer-title';
@@ -56,7 +64,9 @@ export interface DrawerContextDefault {
5664
position: DrawerProps['position'];
5765
drawerContainerRef: React.RefObject<HTMLDivElement>;
5866
transitionDuration: { duration: number };
59-
getFloatingProps: ( props?: React.HTMLProps<HTMLElement> ) => Record<string, unknown>;
67+
getFloatingProps: (
68+
props?: React.HTMLProps<HTMLElement>
69+
) => Record<string, unknown>;
6070
scrollLock: boolean;
6171
context: FloatingContext;
6272
className?: string;
@@ -120,18 +130,21 @@ const Drawer = ( {
120130
const dismiss = useDismiss( context, {
121131
enabled: exitOnEsc || exitOnClickOutside,
122132
escapeKey: exitOnEsc,
123-
outsidePress: exitOnClickOutside,
133+
outsidePress: ( event ) => {
134+
if ( ! exitOnClickOutside ) {
135+
return false;
136+
}
137+
const target = event?.target as HTMLElement;
138+
const isToastElement = target?.closest( 'ul.fui-toast-container' );
139+
return ! isToastElement;
140+
},
124141
} );
125142

126143
const role = useRole( context, { role: 'dialog' } );
127144

128145
const click = useClick( context );
129146

130-
const { getFloatingProps } = useInteractions( [
131-
dismiss,
132-
role,
133-
click,
134-
] );
147+
const { getFloatingProps } = useInteractions( [ dismiss, role, click ] );
135148

136149
const renderTrigger = useCallback( () => {
137150
if ( isValidElement( trigger ) ) {

src/components/toaster/toaster.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const Toaster = ( {
6666
return (
6767
<ul
6868
className={ cn(
69-
'fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3',
69+
'fui-toast-container fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3',
7070
positionClassNames[ position ] ?? positionClassNames[ 'top-right' ],
7171
className
7272
) }
@@ -227,7 +227,9 @@ export const Toast = ( {
227227
closeIconClassNames[ theme ] ??
228228
closeIconClassNames.light
229229
) }
230-
onClick={ () => {
230+
onClick={ ( event ) => {
231+
event.preventDefault();
232+
event.stopPropagation();
231233
if ( typeof removeToast !== 'function' ) {
232234
return;
233235
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"force-ui": "1.7.6"
2+
"force-ui": "1.7.7"
33
}

0 commit comments

Comments
 (0)