Skip to content

Commit 538dd2b

Browse files
Update to upstream @floating-ui/core@1.6.2 (#16)
* Update to upstream @floating-ui/core@1.6.2 * Fix constraining floating element to viewport --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Danielle Huisman <danielle@nixy.software>
1 parent bc218f3 commit 538dd2b

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

packages/core/src/middleware/size.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,25 @@ impl<'a, Element: Clone, Window: Clone> Middleware<Element, Window> for Size<'a,
161161
}
162162
}
163163

164-
let overflow_available_height = height - overflow.side(height_side);
165-
let overflow_available_width = width - overflow.side(width_side);
164+
let maximum_clipping_height = height - overflow.top - overflow.bottom;
165+
let maximum_clipping_width = width - overflow.left - overflow.right;
166+
167+
let overflow_available_height =
168+
maximum_clipping_height.min(height - overflow.side(height_side));
169+
let overflow_available_width =
170+
maximum_clipping_width.min(width - overflow.side(width_side));
166171

167172
let no_shift = state.middleware_data.get(SHIFT_NAME).is_none();
168173

169174
let mut available_height = overflow_available_height;
170175
let mut available_width = overflow_available_width;
171176

172177
if is_y_axis {
173-
let maximum_clipping_width = width - overflow.left - overflow.right;
174178
available_width = match alignment.is_some() || no_shift {
175179
true => overflow_available_width.min(maximum_clipping_width),
176180
false => maximum_clipping_width,
177181
};
178182
} else {
179-
let maximum_clipping_height = height - overflow.top - overflow.bottom;
180183
available_height = match alignment.is_some() || no_shift {
181184
true => overflow_available_height.min(maximum_clipping_height),
182185
false => maximum_clipping_height,

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.6.1"
2+
core = "1.6.2"
33
dom = "1.6.5"
44
utils = "0.2.2"
55
vue = "1.0.6"

0 commit comments

Comments
 (0)