Skip to content

Commit 98b1cfa

Browse files
committed
Fixed overlay when animation is set to false
1 parent a6ef61d commit 98b1cfa

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
## v1.1.1
2+
3+
- Fix overlay when `animation` is set to false
4+
15
## v1.1.0
26

3-
- Added `onPressOut` event on `Dialog` component
4-
- Added `animation` prop on `Dialog` component
5-
- Removed blur library (the user can import whatever blur library), no Expo necessary
6-
- Changed portal library
7-
- Removed `react-native-reanimated` and used `react-native` library for animations
8-
- Moved from `dist` to `build`
7+
- Add `onPressOut` event on `Dialog` component
8+
- Add `animation` prop on `Dialog` component
9+
- Remove blur library (the user can import whatever blur library), no Expo necessary
10+
- Change portal library
11+
- Remove `react-native-reanimated` and used `react-native` library for animations
12+
- Move from `dist` to `build`
913

1014
## v1.0.0
1115

build/Dialog.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function Dialog({ open, onPressOut, tint = "dark", animation = true, dura
88
const progress = useRef(new Animated.Value(open ? 1 : 0)).current;
99
useEffect(() => {
1010
if (!animation) {
11+
progress.setValue(open ? 1 : 0);
1112
setMounted(open);
1213
return;
1314
}

example/app/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ export default function IndexPage() {
4242
slideFrom="none"
4343
BlurComponent={BlurView}
4444
/>
45+
<DefaultDialog
46+
buttonLabel="OPEN NO ANIM DIALOG"
47+
buttonColor="brown"
48+
slideFrom="none"
49+
animation={false}
50+
/>
4551
<InputDialog
4652
buttonLabel="OPEN INPUT DIALOG"
4753
buttonColor="midnightblue"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ontech7/react-native-dialog",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Dialog component for React Native, structure similar to shadcn/ui. Compatible with Android & iOS.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/Dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function Dialog({
3939

4040
useEffect(() => {
4141
if (!animation) {
42+
progress.setValue(open ? 1 : 0);
4243
setMounted(open);
4344
return;
4445
}

0 commit comments

Comments
 (0)