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/select): reset input text on blur #1195

Merged
merged 11 commits into from
Apr 23, 2024

Conversation

ridvandmrc
Copy link
Contributor

@ridvandmrc ridvandmrc commented Apr 5, 2024

user DOM manipulation to update it

๐Ÿ’ก What is the current behavior?

Label is not visible if text is removed from input.

GitHub Issue Number: Closes #1191

๐Ÿ†• What is the new behavior?

  • Now the label is visible if the item selected

๐Ÿ 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

user DOM manipulation to update it
Copy link

changeset-bot bot commented Apr 5, 2024

๐Ÿฆ‹ Changeset detected

Latest commit: 5739df9

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

@danielleroux
Copy link
Collaborator

๐Ÿ™‹โ€โ™‚๏ธ Please don't ignore the checklist of the pull request after you already checked the points. There is no testcase added.

@ridvandmrc
Copy link
Contributor Author

๐Ÿ™‹โ€โ™‚๏ธ Please don't ignore the checklist of the pull request after you already checked the points. There is no testcase added.

Done ๐Ÿ‘

@jul-lam
Copy link
Collaborator

jul-lam commented Apr 11, 2024

Upon review, I identified a minor error. When the select component is utilized with the editable property set to true, the add field fails to reset.

Animation

Code:

<ix-select editable value="1">
  <ix-select-item label="Item 1" value="1"></ix-select-item>
  <ix-select-item label="Item 2" value="2"></ix-select-item>
  <ix-select-item label="Item 3" value="3"></ix-select-item>
  <ix-select-item label="Item 4" value="4"></ix-select-item>
</ix-select>

@danielleroux danielleroux added this to the 2.2.0 milestone Apr 12, 2024
@danielleroux danielleroux added the wait for response Wait for author response label Apr 15, 2024
@ridvandmrc
Copy link
Contributor Author

ridvandmrc commented Apr 15, 2024

Upon review, I identified a minor error. When the select component is utilized with the editable property set to true, the add field fails to reset.

Hi @danielleroux, @jul-lam
I don't quite understand the issue, after you click the outside it resets the input, If you select the new item also it is working as expected. can you please share the requirement ?

@jul-lam
Copy link
Collaborator

jul-lam commented Apr 15, 2024

Hi @ridvandmrc

In the given example, the 'add' field (+ abc) does not reset. This issue only arises when the ix-select is used in 'editable'. The requirement for 'editable' is to add a new value by clicking the + {NEW VALUE} button, which appears when a novel value is entered. However, the current problem is that this field remains even if the value is reset by clicking outside. For instance, in the example above, the field + abc persists even after resetting to Item 4. In this case no 'add' field should be visible, since Item 4 is not a novel value.

@ridvandmrc
Copy link
Contributor Author

ridvandmrc commented Apr 15, 2024

Hi @jul-lam ,
I see, I have just updated the PR, you can check it again.

@danielleroux danielleroux removed the wait for response Wait for author response label Apr 15, 2024
Copy link
Collaborator

@jul-lam jul-lam left a comment

Choose a reason for hiding this comment

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

Thank you, it looks good! Nonetheless, could you please add one more test for the editable case.

@ridvandmrc
Copy link
Contributor Author

Thank you, it looks good! Nonetheless, could you please add one more test for the editable case.

Hi @jul-lam @danielleroux ,
New test cases are added related editable select .

@ridvandmrc ridvandmrc requested a review from jul-lam April 17, 2024 13:30
Copy link
Collaborator

@jul-lam jul-lam left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests.

packages/core/src/components/select/test/select.ct.ts Outdated Show resolved Hide resolved
packages/core/src/components/select/test/select.ct.ts Outdated Show resolved Hide resolved
packages/core/src/components/select/test/select.ct.ts Outdated Show resolved Hide resolved
@ridvandmrc ridvandmrc requested a review from jul-lam April 18, 2024 08:16
jul-lam
jul-lam previously approved these changes Apr 23, 2024
danielleroux
danielleroux previously approved these changes Apr 23, 2024
@danielleroux danielleroux changed the title fix(select): fixed text when reselect the item, fix(core/select): reset input text on blur Apr 23, 2024
@danielleroux danielleroux merged commit 3542def into siemens:main Apr 23, 2024
13 checks passed
@github-actions github-actions bot mentioned this pull request Apr 23, 2024
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.

Label is not displaying in Ix Select
4 participants