Skip to content

Commit ade8403

Browse files
feat: update to upstream @floating-ui/core@1.7.1 (#148)
* feat: update to upstream @floating-ui/core@1.7.1 * fix(core): only allow fallback to the perpendicular axis if all placements on the preferred side axis overflow the main axis with cross axis set to alignment --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Daniëlle Huisman <danielle@huisman.me>
1 parent 83318b4 commit ade8403

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/core/src/middleware/flip.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,14 @@ impl<Element: Clone + PartialEq, Window: Clone + PartialEq> Middleware<Element,
300300
} else {
301301
false
302302
};
303-
let has_initial_main_axis_overflow = overflows_data
304-
.first()
305-
.and_then(|overflow| overflow.overflows.first())
306-
.is_some_and(|overflow| *overflow > 0.0);
307303

308-
if !ignore_cross_axis_overflow || has_initial_main_axis_overflow {
304+
if !ignore_cross_axis_overflow ||
305+
// We leave the current main axis only if every placement on that axis overflows the main axis.
306+
overflows_data.iter().all(|d| {
307+
d.overflows.first().is_some_and(|overflow| *overflow > 0.0)
308+
&& get_side_axis(d.placement) == initial_side_axis
309+
})
310+
{
309311
// Try next placement and re-run the lifecycle.
310312
return MiddlewareReturn {
311313
x: None,

upstream.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[releases]
2-
core = "1.7.0"
2+
core = "1.7.1"
33
dom = "1.7.0"
44
utils = "0.2.9"
55
vue = "1.1.6"

0 commit comments

Comments
 (0)