File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 1
1
## [ Unreleased]
2
2
3
+ ### Fixed
4
+
5
+ - ** General** : Fix issue where presence closing animation doesn't work as expected
6
+
3
7
## [ 5.18.2] - 2025-07-26
4
8
5
9
### Fixed
Original file line number Diff line number Diff line change 1
- type PossibleRef < T > = T | ( ( el : T ) => void ) | undefined
1
+ import { createEffect , createSignal , on } from 'solid-js'
2
2
3
- const isRefFn = < T > ( ref : PossibleRef < T > ) : ref is ( el : T ) => void => typeof ref === 'function'
3
+ type PossibleRef < T > = T | ( ( el : T ) => void ) | undefined
4
4
5
- function setRef < T > ( ref : PossibleRef < T > , value : T ) {
6
- if ( isRefFn ( ref ) ) {
7
- ref ( value )
8
- }
9
- }
5
+ const isRefFn = < T > ( ref : PossibleRef < T > ) : ref is ( el : T | null ) => void => typeof ref === 'function'
10
6
11
7
export function composeRefs < T > ( ...refs : PossibleRef < T > [ ] ) {
12
- return ( node : T ) => {
13
- for ( const ref of refs ) {
14
- setRef ( ref , node )
15
- }
16
- }
8
+ const [ node , setNode ] = createSignal < T | null > ( null )
9
+ createEffect (
10
+ on ( node , ( el ) => {
11
+ for ( const ref of refs ) {
12
+ if ( isRefFn ( ref ) ) {
13
+ ref ( el )
14
+ }
15
+ }
16
+ } ) ,
17
+ )
18
+ return setNode
17
19
}
You can’t perform that action at this time.
0 commit comments