File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,11 @@ impl Widget for Text {
57
57
} ;
58
58
59
59
match key {
60
- exit_keys ! ( ) => return Ok ( Broadcast :: Exited ) ,
60
+ exit_keys ! ( ) => {
61
+ self . content . try_borrow_mut ( ) ?. take ( ) ;
62
+
63
+ return Ok ( Broadcast :: Exited ) ;
64
+ }
61
65
Keypress :: Printable ( x) => {
62
66
self . content
63
67
. try_borrow_mut ( ) ?
@@ -128,4 +132,11 @@ impl Widget for Text {
128
132
129
133
Ok ( ( ) )
130
134
}
135
+
136
+ fn placement ( & self ) -> super :: Placement {
137
+ super :: Placement {
138
+ vertical : super :: Constraint :: Length ( 3 ) ,
139
+ ..Default :: default ( )
140
+ }
141
+ }
131
142
}
Original file line number Diff line number Diff line change @@ -258,8 +258,13 @@ impl Widget for Filtered {
258
258
if let Some ( Keypress :: Printable ( '/' ) ) = event. key ( ) {
259
259
TABLE_FILTER . inc ( ) ;
260
260
261
- self . view
262
- . push ( Text :: builder ( ) . title ( "Filter" ) . build ( ) . boxed ( ) ) ;
261
+ self . view . push (
262
+ Text :: builder ( )
263
+ . title ( "Filter" )
264
+ . content ( self . filter . clone ( ) )
265
+ . build ( )
266
+ . boxed ( ) ,
267
+ ) ;
263
268
264
269
return Ok ( Broadcast :: Consumed ) ;
265
270
}
You can’t perform that action at this time.
0 commit comments