Skip to content

fix(core): prevent undefined access of ref elements#2570

Open
danielleroux wants to merge 2 commits into
mainfrom
fix/undefined-access-of-refs
Open

fix(core): prevent undefined access of ref elements#2570
danielleroux wants to merge 2 commits into
mainfrom
fix/undefined-access-of-refs

Conversation

@danielleroux
Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

GitHub Issue Number: #2568

🆕 What is the new behavior?

Make ref check before accessing tabIndex

🏁 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
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-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

@netlify
Copy link
Copy Markdown

netlify Bot commented May 27, 2026

Deploy Preview for ix-storybook canceled.

Name Link
🔨 Latest commit 2165495
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a169bf17c6d3f000882ed12

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: 2165495

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

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-docs 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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a helper function forceTabIndex to safely apply tabIndex during the render phase, preventing undefined access issues in ix-date-input, ix-dropdown-button, and ix-time-input. It also removes non-null assertions from ref callbacks. The review feedback suggests typing the element parameter in forceTabIndex to accept null to align with Stencil's unmounting behavior, handling potential null values when assigning menuItemsContainer in menu-category.tsx, and correcting a typo in the changeset file.

Comment thread packages/core/src/components/utils/a11y.ts
Comment thread packages/core/src/components/menu-category/menu-category.tsx
Comment thread .changeset/steady-tab-order.md Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant