Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions packages/@react-spectrum/list/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
}

&.react-spectrum-ListView--emphasized {
&.react-spectrum-ListView--dropTarget {
.react-spectrum-ListViewItem:not(.is-selected) {
/* shift bottom border inwards so it doesn't overlap the root drop target */
&:after {
inset-inline-start: 1px;
inset-inline-end: 1px;
}
}
}
.react-spectrum-ListViewItem {
/* common pseudoelement for box shadows */
&:after {
Expand Down Expand Up @@ -509,22 +518,14 @@
inset 0 2px 0 0 var(--spectrum-table-cell-border-color-key-focus);
}

.react-spectrum-ListView--dropTarget {
.react-spectrum-ListView.react-spectrum-ListView--dropTarget {
border-color: var(--spectrum-global-color-blue-500);
background-color: var(--spectrum-alias-highlight-selected);
box-shadow: inset 0 0 0 1px var(--spectrum-table-cell-border-color-key-focus);
&::after {
border-radius: inherit;
border-color: var(--spectrum-global-color-blue-500);
background-color: var(--spectrum-alias-highlight-selected);
box-shadow: inset 0 0 0 1px var(--spectrum-table-cell-border-color-key-focus);
content: '';
display: block;
position: absolute;
top: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;

/* Add border to quiet ListView only when it is a drop target */
&.react-spectrum-ListView--quiet {
box-shadow: inset 0 0 0 1px var(--spectrum-table-cell-border-color-key-focus), 0 0 0 1px var(--spectrum-table-cell-border-color-key-focus);
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/@react-spectrum/list/stories/ListView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ storiesOf('ListView/Drag and Drop', module)
'Drag into folder',
args => (
<Flex direction="row" wrap alignItems="center">
<DragIntoItemExample {...args} />
<DragIntoItemExample listViewProps={args} />
</Flex>
)
)
Expand All @@ -385,7 +385,7 @@ storiesOf('ListView/Drag and Drop', module)
'Drag between lists (Root only)',
args => (
<Flex direction="row" wrap alignItems="center">
<DragBetweenListsRootOnlyExample {...args} />
<DragBetweenListsRootOnlyExample listViewProps={args} />
</Flex>
), {description: {data: 'Folders are non-draggable.'}}
)
Expand Down