Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/ix-menu-category): dynamic added items not visible #1706

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

lzeiml
Copy link
Collaborator

@lzeiml lzeiml commented Feb 24, 2025

💡 What is the current behavior?

Dynamic list of items visualized through the ‘ix-menu-item’ in the ‘ix-menu-category’ are not getting updated when new items are added, only after reopening the menu-category the items appear.

GitHub Issue Number: Closes #1606, IX-2202

🆕 What is the new behavior?

  • Container height of ix-menu-category is now updated when items are added/removed, making dynamically added items visible

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📄 Documentation was reviewed/updated (pnpm run docs)
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: 7862bfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lzeiml lzeiml changed the title adjust max-height when item number changes Fix: [ix-menu-category] dynamic added items not visible Feb 24, 2025
danielleroux

This comment was marked as duplicate.

@danielleroux danielleroux changed the title Fix: [ix-menu-category] dynamic added items not visible fix(core/ix-menu-category): dynamic added items not visible Feb 25, 2025
Copy link
Collaborator

@danielleroux danielleroux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some component tests to verify the fix.

@lzeiml
Copy link
Collaborator Author

lzeiml commented Feb 25, 2025

@danielleroux

Please add some component tests to verify the fix.

76f62c1

`);

await page.locator('ix-menu-expand-icon').click();
await page.locator('ix-menu-category').click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way you don't have to call locator/querySelector multiple times

Suggested change
await page.locator('ix-menu-category').click();
const menuCategory = page.locator('ix-menu-category');
await menuCategory.click();

'div.menu-items.menu-items--expanded[style*="opacity: 1"]'
);

const initialHeight: number | undefined = await page
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing not necessary here

Suggested change
const initialHeight: number | undefined = await page
const initialHeight = await page


expect(initialHeight).toBeDefined();
expect(newHeight).toBeDefined();
expect(newHeight).toBeGreaterThan(initialHeight!);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should come up with a better assertion criterion. Maybe the exact height we expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ix-menu-category dynamic items are not visible
5 participants