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(Dropdown): disable the trigger element if the dropdown have disable="true" #878

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

Cata1989
Copy link
Collaborator

@Cata1989 Cata1989 commented Feb 26, 2024

The purpose of this PR is to address the issue related to the disabled state management in the dropdown component. Previously, the disabled state of the dropdown was not properly synchronized with the associated button's disabled state. This PR fixes that issue by implementing a mechanism to correctly update the button's disabled state based on the dropdown's disabled property. As a result, the dropdown component now ensures consistent behavior when managing its disabled state, enhancing overall accessibility and user experience.

Before After
Screenshot 2024-02-26 at 14 03 47 Screenshot 2024-02-26 at 14 04 29

@Cata1989 Cata1989 changed the title fix(Dropdown): fix dropdown disabled state issue fix(Dropdown): disable the trigger button if the dropdown have disable="true" Feb 26, 2024
@endv-bogdanb
Copy link
Collaborator

Not sure if this the right approach. I could use something else to trigger the dropdown. If we want this behaviour I would suggest to query by trigger slot and set disabled it's children.

@dgonzalezr
Copy link
Collaborator

dgonzalezr commented Feb 26, 2024

Not sure if this is the right approach. I could use something else to trigger the dropdown. If we want this behavior I would suggest querying by trigger slot and setting disabled it's children.

We have discussed it, and your concern is right, but in this case, we would like only to cover the use case when the trigger is a bq-button. We could still set the disable attribute to whatever the trigger element is, I don't see any major issue if the attribute is set to an element that doesn't support disable as an attribute.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dgonzalezr dgonzalezr changed the title fix(Dropdown): disable the trigger button if the dropdown have disable="true" fix(Dropdown): disable the trigger element if the dropdown have disable="true" Feb 26, 2024
@dgonzalezr dgonzalezr merged commit 54c87fd into main Feb 27, 2024
6 checks passed
@dgonzalezr dgonzalezr deleted the fix/dropdown-disabled-state branch February 27, 2024 04:03
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