Skip to content

fix(core/textarea): Added optional chaining to prevent runtime errors when null value passed #1828

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

Conversation

RamVinayMandal
Copy link
Contributor

💡 What is the current behavior?

When value = null is assigned programmatically to <ix-textarea>, the component fails to handle it gracefully. This causes:

  • The internal textarea to disappear (nothing rendered).

  • Console errors when optional chaining is not used.

GitHub Issue Number: #1789

🆕 What is the new behavior?

  • The component now normalizes null values to empty string ('') internally.

  • The textarea remains visible even when value = null.

🏁 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 Apr 8, 2025

🦋 Changeset detected

Latest commit: c784c6a

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

@nuke-ellington nuke-ellington merged commit 0095196 into siemens:main Apr 15, 2025
14 checks passed
This was referenced Apr 15, 2025
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.

3 participants