mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
fix(app): emit transform-origin as x-then-y for native menu popovers (#2911)
CSS accepts transform-origin keyword pairs in either order, but React Native parses them positionally (x first). The vertical-first string crashed anchored menu popovers on native wide form factors with "Transform-origin left can only be used for x-position". Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c59b47b8a6
commit
e1b4058b77
@@ -68,8 +68,8 @@ describe("computePosition", () => {
|
||||
|
||||
describe("getTransformOrigin", () => {
|
||||
it.each([
|
||||
["bottom", "start", "top left"],
|
||||
["top", "end", "bottom right"],
|
||||
["bottom", "start", "left top"],
|
||||
["top", "end", "right bottom"],
|
||||
["right", "center", "center center"],
|
||||
] as const)("maps %s/%s to %s", (placement, alignment, expected) => {
|
||||
expect(getTransformOrigin(placement, alignment)).toBe(expected);
|
||||
|
||||
@@ -155,5 +155,7 @@ export function getTransformOrigin(placement: Placement, alignment: Alignment):
|
||||
else if (alignment === "end") horizontal = "right";
|
||||
else horizontal = "center";
|
||||
|
||||
return `${vertical} ${horizontal}`;
|
||||
// React Native parses transform-origin positionally (x then y), unlike CSS
|
||||
// which accepts keyword pairs in either order.
|
||||
return `${horizontal} ${vertical}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user