Commit b3b520b
committed
Resolves #4183 ([FR-1404](https://lablup.atlassian.net/browse/FR-1404))
## Summary
Fixes the BAIUnmountAfterClose component to ensure it always properly unmounts Modal and Drawer components after close animations complete, regardless of whether parent components provide afterClose or afterOpenChange callback props.
## Problem
The component was using type guards to conditionally add unmounting handlers only when original props existed. This caused the component to fail to unmount when parents didn't provide these callbacks, leading to memory leaks.
## Solution
- Removed conditional type guards (`hasAfterClose`, `hasAfterOpenChange`)
- Always add our own unmounting handlers (`afterClose`, `afterOpenChange`)
- Preserve any existing callbacks while ensuring proper unmounting behavior
- Ensures component unmounts after close animations in all scenarios
## Changes
- Simplified prop handling by always applying unmounting handlers
- Reduced code complexity by removing unnecessary conditional logic
- Maintains backward compatibility with existing callback preservation
[FR-1404]: https://lablup.atlassian.net/browse/FR-1404?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 96450ef commit b3b520b
File tree
1 file changed
+10
-18
lines changed- packages/backend.ai-ui/src/components
1 file changed
+10
-18
lines changedLines changed: 10 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 49 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 50 | + | |
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
| |||
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 62 | + | |
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
| |||
81 | 73 | | |
82 | 74 | | |
83 | 75 | | |
84 | | - | |
| 76 | + | |
85 | 77 | | |
86 | | - | |
| 78 | + | |
87 | 79 | | |
88 | | - | |
| 80 | + | |
89 | 81 | | |
90 | 82 | | |
91 | 83 | | |
| |||
0 commit comments