Skip to content

Commit e0185b8

Browse files
authored
Merge pull request #1262 from nicksenger/fix/overlay-layouts
Fix: overlay layout for `Responsive`
2 parents adce9e0 + a12a92c commit e0185b8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lazy/src/responsive.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ where
178178
let content_layout = state.layout(layout);
179179

180180
match content {
181-
Content::Pending(_) => false,
181+
Content::Pending(_) => None,
182182
Content::Ready(cache) => {
183183
*cache = Some(
184184
CacheBuilder {
@@ -190,14 +190,19 @@ where
190190
.build(),
191191
);
192192

193-
cache.as_ref().unwrap().borrow_overlay().is_some()
193+
cache
194+
.as_ref()
195+
.unwrap()
196+
.borrow_overlay()
197+
.as_ref()
198+
.map(|overlay| overlay.position())
194199
}
195200
}
196201
};
197202

198-
has_overlay.then(|| {
203+
has_overlay.map(|position| {
199204
overlay::Element::new(
200-
layout.position(),
205+
position,
201206
Box::new(Overlay { instance: self }),
202207
)
203208
})

0 commit comments

Comments
 (0)