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 (AIQ-5472): Update multiselect input click to toggle menu #146

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

cafloyd
Copy link
Member

@cafloyd cafloyd commented Oct 17, 2024

Description

Updates multiselect input and 'plus' icon click event to toggle menu state between open and closed.

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
💯 Add tests
🔗 Update dependencies
📜 Docs
💅 Styling

Updates

Before

Clicking on the input or the 'plus' icon opens the menu, but does not close it upon a second click:
https://github.com/user-attachments/assets/03da37a5-f383-4f16-8bdb-ba3ab506d616

After

Clicking on the input or the 'plus' icon toggles the menu state:
https://github.com/user-attachments/assets/428ac861-8e4e-41de-bffd-9e531a688ec4

src/SelectMulti.vue Outdated Show resolved Hide resolved
@cafloyd
Copy link
Member Author

cafloyd commented Oct 21, 2024

Hey @atsunechka and @ivan-shtyrlyaev-nitka - if you have time tomorrow, would you mind taking a look at this PR, since you worked on #142, which is related?

This PR is a follow-up to that PR, intended to allow the user to click to toggle between open and closed menu states (right now clicking on the menu only opens it). The solution I have feels clunky, so I'm definitely open to suggestions if there's a better way to achieve this!

@@ -406,7 +414,7 @@
:placeholder="placeholder"
:aria-placeholder="placeholder"
@blur="onInputBlur"
@click="updateMenuState(true)"
@click="updateMenuState(!open, !open)"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't this it's a good solution.
If we click on input it implies it's focused. and it means we need to have menu opened .
If we need to close menu on second input click - it's a wrong requirement (imo)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I'll revert this change!

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, sorry @ivan-shtyrlyaev-nitka I misread this comment - I think it's standard and expected behavior for a second click to close the menu, and it would be confusing to the user if they didn't see that behavior.
Here are recordings of a few examples I found - I wasn't able to find any example where a second click didn't close the menu:

Google:
https://github.com/user-attachments/assets/8e97b96b-e9ae-4884-bd0c-7ec3f4390472
Outlook:
https://github.com/user-attachments/assets/2f78f6b1-c4bb-48d5-a866-61231495e2a1
Github:
https://github.com/user-attachments/assets/79643eec-6123-4ee8-be6b-12cdc0f45105
Jira:
https://github.com/user-attachments/assets/72b79894-bd8b-4326-adae-4071ce32115e

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for explaining your thinking on this point, @ivan-shtyrlyaev-nitka ! You were right after all and I updated this PR to only support toggle behavior on the icon but not on the input. I also replicated these changes for main with this PR: #147

@cafloyd cafloyd force-pushed the fix/AIQ-5472-1 branch 2 times, most recently from 40d9a92 to 7699420 Compare October 23, 2024 16:11
@cafloyd cafloyd merged commit ea21e3f into next Oct 24, 2024
1 check passed
@cafloyd cafloyd deleted the fix/AIQ-5472-1 branch October 24, 2024 13:30
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