我在一个React库中使用Amplify UI,并制作了显示用户和他们的一些信息的卡片。然而,如果他们有太多的信息,溢出就会被切断,可以在另一个页面上看到。除了一些用户的Macbook之外,一切看起来都很好。我很困惑,因为即使是iPhones也没有这个问题。
下面是用户卡的样子:
但它最终在一些人的MacBook上看起来像这样:
请忽略个人信息的红色标记。
下面是我调用Amplify从我的figma代码生成的组件的方法:
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",
},
下面是从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>
是否有其他东西可以添加到这些容器中,使MacBook Safari现在显示堆叠的信息?
1条答案
按热度按时间c2e8gylq1#
这很可能是因为
overflow: clip
is not supported on Safari Desktop on version 15 or lower。最近没有更新基础Mac OSX操作系统的用户将使用这些版本(在Mac上,Safari版本与OS版本绑定)。clip
的行为类似于hidden
。这可能会或可能不会正确显示,但请尝试更改:收件人: