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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: overflow item style should be applied when overflow items are nested in wrapper elements",
"packageName": "@fluentui/react-overflow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
25 changes: 25 additions & 0 deletions packages/react-components/react-overflow/src/Overflow.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,31 @@ describe('Overflow', () => {
});
});

it(`should overflow items when there's more than one child element`, () => {
const mapHelper = new Array(10).fill(0).map((_, i) => i);
const overflowElementIndex = 6;
mount(
<Container width={350}>
<div>
{mapHelper.map(i => (
<Item key={i} id={i.toString()}>
{i}
</Item>
))}
<Menu />
</div>
</Container>,
);

cy.get(`[${selectors.item}]`).each((value, index) => {
if (index >= overflowElementIndex) {
expect(Cypress.$(value).css('display')).to.equal('none');
} else {
expect(Cypress.$(value).css('display')).to.equal('inline-block');
}
});
});

it(`should overflow items in reverse order`, () => {
const mapHelper = new Array(10).fill(0).map((_, i) => i);
mount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const useStyles = makeStyles({
},

overflowingItems: {
[`& > [${DATA_OVERFLOWING}]`]: {
[`& [${DATA_OVERFLOWING}]`]: {
display: 'none',
},
},
Expand Down