Skip to content

Commit fb750ce

Browse files
authored
fix ListView item's thumbnail height overflow (#3301)
1 parent 263db83 commit fb750ce

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

packages/@react-spectrum/list/src/ListViewItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ export function ListViewItem<T>(props: ListViewItemProps<T>) {
250250
slots={{
251251
text: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content']},
252252
description: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-description'], ...descriptionProps},
253-
illustration: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-illustration']},
254-
image: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-image']},
253+
illustration: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-thumbnail']},
254+
image: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-thumbnail']},
255255
actionButton: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'], isQuiet: true},
256256
actionGroup: {
257257
UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'],

packages/@react-spectrum/list/src/styles.css

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@
279279
grid-template-columns: auto auto auto auto 1fr auto auto;
280280
grid-template-rows: 1fr auto;
281281
grid-template-areas:
282-
"draghandle checkbox icon image content actions actionmenu chevron"
283-
"draghandle checkbox icon image description actions actionmenu chevron";
282+
"draghandle checkbox thumbnail content actions actionmenu chevron"
283+
"draghandle checkbox thumbnail description actions actionmenu chevron";
284284
align-items: center;
285285
}
286286

@@ -326,9 +326,8 @@
326326
}
327327
}
328328

329-
.react-spectrum-ListViewItem-illustration,
330-
.react-spectrum-ListViewItem-image {
331-
grid-area: image;
329+
.react-spectrum-ListViewItem-thumbnail {
330+
grid-area: thumbnail;
332331
justify-items: center;
333332
padding-inline-end: var(--spectrum-global-dimension-size-100);
334333
display: flex;
@@ -338,10 +337,9 @@
338337
align-items: center;
339338
justify-content: center;
340339

341-
> img, svg {
340+
> img, > svg {
342341
width: unset;
343-
height: unset;
344-
max-height: 100%;
342+
height: 100%;
345343
}
346344
}
347345

@@ -403,8 +401,8 @@
403401

404402
.react-spectrum-ListViewItem-grid {
405403
grid-template-areas:
406-
"icon image content . badge"
407-
"icon image description . badge";
404+
"thumbnail content . badge"
405+
"thumbnail description . badge";
408406
grid-template-columns: auto auto auto 1fr;
409407
}
410408

packages/@react-spectrum/list/stories/ListView.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function IllustrationContainer(props) {
119119
function Folder() {
120120
return (
121121
<IllustrationContainer>
122-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.23 67" height="110">
122+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.23 67">
123123
<path fill="var(--spectrum-global-color-gray-600)" d="M94.47,27a4.45,4.45,0,0,0-3.72-2H20.34a5.45,5.45,0,0,0-5.05,3.37L3.12,57.68V3.88A.89.89,0,0,1,4,3H23.21a2.51,2.51,0,0,1,1.69.66l9.7,8.94a1.56,1.56,0,0,0,1,.4h40a1.5,1.5,0,0,1,1.5,1.5v6a1.5,1.5,0,0,0,3,0v-6a4.51,4.51,0,0,0-4.5-4.5H36.21L26.93,1.46A5.48,5.48,0,0,0,23.21,0H4A3.88,3.88,0,0,0,.12,3.88v61h0A1.51,1.51,0,0,0,1.5,67H79a1.49,1.49,0,0,0,1.38-.92L94.89,31.19A4.45,4.45,0,0,0,94.47,27ZM92.12,30,78,64H3.75L18.06,29.52A2.46,2.46,0,0,1,20.34,28H90.75a1.48,1.48,0,0,1,1.37,2Z" />
124124
</svg>
125125
</IllustrationContainer>

0 commit comments

Comments
 (0)