Commit b87e2e8 1 parent 1af5b25 commit b87e2e8 Copy full SHA for b87e2e8
File tree 6 files changed +25
-19
lines changed
6 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ pub fn Drawer(
113
113
>
114
114
<div
115
115
class=class_list![
116
- "thaw-drawer" , move || format!( "thaw-drawer--placement-{}" , placement
117
- . get( ) ) , class. map( | c | move || c. get( ) )
116
+ "thaw-drawer" , move || format!( "thaw-drawer--placement-{}" ,
117
+ placement . get( ) ) , class. map( | c | move || c. get( ) )
118
118
]
119
119
120
120
style=move || display. get( )
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ pub fn Layout(
58
58
)
59
59
} )
60
60
>
61
+
61
62
{ children( ) }
62
63
</Scrollbar >
63
64
</div>
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ pub fn Modal(
64
64
} ) ;
65
65
66
66
view ! {
67
- <Teleport immediate=show. signal( ) >
67
+ <Teleport immediate=show. signal( ) >
68
68
<FocusTrap disabled=!close_on_esc active=show. signal( ) on_esc>
69
69
<div
70
70
class="thaw-modal-container"
@@ -73,7 +73,13 @@ pub fn Modal(
73
73
>
74
74
<Scrollbar
75
75
content_style="min-height: 100%; display: flex;"
76
- style=Signal :: derive( move || if displayed. get( ) { String :: new( ) } else { String :: from( "display: none" ) } )
76
+ style=Signal :: derive( move || {
77
+ if displayed. get( ) {
78
+ String :: new( )
79
+ } else {
80
+ String :: from( "display: none" )
81
+ }
82
+ } )
77
83
comp_ref=scrollbar_ref
78
84
>
79
85
<CSSTransition
Original file line number Diff line number Diff line change @@ -291,12 +291,14 @@ pub fn Scrollbar(
291
291
class=class_list![
292
292
"thaw-scrollbar__content" , content_class. map( | c | move || c. get( ) )
293
293
]
294
+
294
295
style=move || {
295
296
format!(
296
297
"width: fit-content; {}" ,
297
298
content_style. as_ref( ) . map_or( String :: new( ) , |s| s. get( ) ) ,
298
299
)
299
300
}
301
+
300
302
ref=content_ref
301
303
>
302
304
{ children( ) }
Original file line number Diff line number Diff line change 1
- use leptos:: { leptos_dom:: helpers:: WindowListenerHandle , * } ;
2
- use std:: cell:: RefCell ;
1
+ use leptos:: * ;
3
2
4
3
#[ cfg( any( feature = "csr" , feature = "hydrate" ) ) ]
5
4
thread_local ! {
6
- static STACK : RefCell <Vec <uuid:: Uuid >> = Default :: default ( ) ;
5
+ static STACK : std :: cell :: RefCell <Vec <uuid:: Uuid >> = Default :: default ( ) ;
7
6
}
8
7
9
8
#[ component]
@@ -15,6 +14,7 @@ pub fn FocusTrap(
15
14
) -> impl IntoView {
16
15
#[ cfg( any( feature = "csr" , feature = "hydrate" ) ) ]
17
16
if disabled == false {
17
+ use leptos:: leptos_dom:: helpers:: WindowListenerHandle ;
18
18
let esc_handle = StoredValue :: new ( None :: < WindowListenerHandle > ) ;
19
19
let id = StoredValue :: new ( uuid:: Uuid :: new_v4 ( ) ) ;
20
20
@@ -55,5 +55,12 @@ pub fn FocusTrap(
55
55
} ) ;
56
56
}
57
57
58
+ #[ cfg( not( any( feature = "csr" , feature = "hydrate" ) ) ) ]
59
+ {
60
+ let _ = disabled;
61
+ let _ = active;
62
+ let _ = on_esc;
63
+ }
64
+
58
65
children ( )
59
66
}
Original file line number Diff line number Diff line change @@ -60,17 +60,7 @@ pub fn Teleport(
60
60
} else {
61
61
let _ = mount;
62
62
let _ = immediate;
63
- #[ cfg( not( feature = "ssr" ) ) ]
64
- {
65
- let _ = element;
66
- let _ = children;
67
- }
68
- #[ cfg( feature = "ssr" ) ]
69
- if element. is_none( ) {
70
- if let Some ( children) = children {
71
- // Consumed hydration `id`
72
- let _ = children( ) ;
73
- }
74
- }
63
+ let _ = element;
64
+ let _ = children;
75
65
} }
76
66
}
You can’t perform that action at this time.
0 commit comments