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: drop down close issue of multiselect component #1265

Conversation

Spiral-Memory
Copy link

@Spiral-Memory Spiral-Memory commented Jan 16, 2024

Proposed changes (including videos or screenshots)

I've created a handleOnMouseDown function to control the visibility of the dropdown menu.

In the Anchor component, the onClick prop has been assigned an empty function since it's already being managed by the handleMouseDown function provided as a prop on the Box component. Additionally, a custom function called handleBlur has been introduced and is now assigned to the onBlur prop of the anchor component. This function is responsible for hiding the dropdown only when necessary. The handleClick function has also been modified to only work in creating focus within the box.

The sequence of actions is as follows: onMouseDown first, followed by onBlur, and finally onClick.

2024-01-16.22-50-44.mp4

Issue(s)

Closes #1305

Further comments

The issue occurred because the onBlur event, responsible for hiding the dropdown when clicking outside, executed before the onClick event. Therefore, clicking inside the box, such as on the arrow icon, triggered the onBlur event to hide the dropdown, and then the onClick event mistakenly thought it was hidden and displayed it again. To address this, I employed the onMouseDown event to better manage these scenarios.

Copy link

changeset-bot bot commented Jan 16, 2024

⚠️ No Changeset found

Latest commit: d8101fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Sayan4444
Copy link

@Spiral-Memory Great work buddy

@Spiral-Memory
Copy link
Author

@Spiral-Memory Great work buddy

Thank you for the appreciation @Sayan4444

@Spiral-Memory Spiral-Memory force-pushed the fix/multiselect-dropdown-close-issue branch from 83b6f27 to d8101fb Compare February 17, 2024 19:03
@dougfabris
Copy link
Member

dougfabris commented Feb 27, 2024

Hi there, thanks for the contribution! 🚀 💯

We're planning an entire replacement of all the components related to AutoComplete and all the Select components since we're focusing a lot on accessibility. Trying to maintain it became a nightmare, and because of that we're not going to accept any contributions related to these components at this time.


Questions? Help needed? Feature Requests?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

@dougfabris dougfabris closed this Feb 27, 2024
@Spiral-Memory
Copy link
Author

Hi there, thanks for the contribution! 🚀 💯

We're planning an entire replacement of all the components related to AutoComplete and all the Select components since we're focusing a lot on accessibility. Trying to maintain it became a nightmare, and because of that we're not going to accept any contributions related to these components at this time.


Questions? Help needed? Feature Requests?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

Got it, @dougfabris . Thanks for the appreciation. Well I recently discovered an issue in RC where the link is wrapped in the time component, which is incorrect behavior. I've attempted to fix that. It would be great if you could provide feedback on this PR as well: RocketChat/Rocket.Chat#31748

@dougfabris
Copy link
Member

@Spiral-Memory I already addressed the issue to the design team, as soon as they answer I will share the news with you!
Thanks for helping us!

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.

[BUG] Dropdown for adding roles during new member addition does not close when the up/down icon is clicked.
3 participants