I'm using Amplify UI in the React library and making a card that displays the user and some of his information. However, if they have too much information, the overflow is cut off and can be seen on another page. Everything looks fine except for some users' Macbooks. I'm confused because I haven't had this problem even with my Iphone.
The user card should look like this:
But on some people's MacBooks it ends up looking like this:
Please ignore the red mark of personal information.
Here's how I call Amplify the component generated from Figma code:
Bio: { overflow: "fade", style: { WebkitOverflowScrolling: "touch", // for webit browsers to prevent stacked letters whiteSpace: "nowrap", }, maxHeight: "80px", fontSize: { base: ".875rem", medium: ".875rem" }, }, Subjects: { alignItems: "flex-start", overflow: "clip", style: { WebkitOverflowScrolling: "touch", // for webit browsers to prevent stacked letters whiteSpace: "nowrap", }, maxHeight: "60px", wrap: "wrap", gap: "xs", alignContent: "flex-start", },
Here is the component code snippet generated by Amplify:
<Flex gap="4px" direction="row" width="unset" height="unset" justifyContent="flex-start" alignItems="center" shrink="0" position="relative" padding="0px 0px 0px 0px" children={subjects} {...getOverrideProps(overrides, "Subjects")} ></Flex> ... <Text fontFamily="Inter" fontSize="16px" fontWeight="400" color="rgba(48,64,80,1)" lineHeight="24px" textAlign="left" display="block" direction="column" justifyContent="unset" width="unset" height="unset" gap="unset" alignItems="unset" shrink="0" alignSelf="stretch" position="relative" padding="0px 0px 0px 0px" whiteSpace="pre-wrap" isTruncated={true} children={tutor?.bio} {...getOverrideProps(overrides, "Bio")} ></Text>
Is there anything else I can add to these containers so that MacBook safari now displays stacked information?
P粉2877263082024-03-31 14:25:19
This is most likely due to overflow: Clip
Version 15 or earlier of the Safari desktop version is not supported < /a>. Users who have not recently updated the base Mac OSX operating system will be stuck with these versions (On Mac, the safari version is related to the operating system version).
clip
behaves similarly to hidden
. This may or may not display correctly, but try changing:
Subjects: { alignItems: "flex-start", overflow: "clip", style: { WebkitOverflowScrolling: "touch", // for webit browsers to prevent stacked letters whiteSpace: "nowrap", }, maxHeight: "60px", wrap: "wrap", gap: "xs", alignContent: "flex-start", },
To:
Subjects: { alignItems: "flex-start", overflow: "hidden", style: { WebkitOverflowScrolling: "touch", // for webit browsers to prevent stacked letters whiteSpace: "nowrap", }, maxHeight: "60px", wrap: "wrap", gap: "xs", alignContent: "flex-start", },