Skip to content

Conversation

GayatriK2002
Copy link
Contributor

@GayatriK2002 GayatriK2002 commented Aug 20, 2025

💡 What is the current behavior?

  • When the filterState property of the category filter component is set programmatically (e.g., through code), the input element automatically receives focus, even if the focus was previously on another element outside the category filter component.
  • This behavior occurs regardless of whether the input element was already focused or not.
  • The unexpected focus change can disrupt the user experience and cause confusion.

GitHub Issue Number: #

🆕 What is the new behavior?

  • The category filter component has been updated to prevent the input element from automatically receiving focus when the filterState is set programmatically.

🏁 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

Copy link

changeset-bot bot commented Aug 20, 2025

🦋 Changeset detected

Latest commit: dbd9bb6

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

This PR includes changesets to release 1 package
Name Type
@siemens/ix 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

@GayatriK2002 GayatriK2002 marked this pull request as ready for review August 25, 2025 09:40
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will only work if the input is already focused. If the the user clicks the dropdown or navigates it via keyboard this will the focus will not work anymore.
Maybe we can extract the focus logic from addToken and add it to the respective event handlers only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right. I have updated the code now

Copy link

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