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 bug where user can't type disabled option into combobox #2294

Merged
merged 12 commits into from
Jul 30, 2024

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented Jul 19, 2024

Pull Request

🀨 Rationale

Fixes #2252

πŸ‘©β€πŸ’» Implementation

The options getter should not revert to returning all the options (i.e. _options) when filteredOptions is empty. Doing so can lead to setting a selectedIndex that points to an option that is filtered out or disabled.

The expected behavior now is that a disabled option functions exactly like an enabled option, except that it cannot be clicked, cannot be focused in the dropdown, and appears dimmed. Like enabled options, t can be filtered to (if the input text matches it), and the user can set the control's value to it by typing it in fully.

πŸ§ͺ Testing

Added new tests

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@m-akinc m-akinc requested a review from jattasNI July 24, 2024 17:42
@rajsite
Copy link
Member

rajsite commented Jul 26, 2024

@atmgrifter00 it looks like there were changes since your last review, could you give it another check JIC?

@atmgrifter00 atmgrifter00 self-requested a review July 26, 2024 18:04
Copy link
Contributor

@jattasNI jattasNI left a comment

Choose a reason for hiding this comment

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

Resetting my vote because I'd like to do one more round of testing based on the final implementation after the last bit of feedback is addressed

@jattasNI jattasNI self-requested a review July 29, 2024 15:37
@m-akinc m-akinc enabled auto-merge (squash) July 30, 2024 16:18
@m-akinc m-akinc merged commit 383345a into main Jul 30, 2024
11 checks passed
@m-akinc m-akinc deleted the users/makinc/fix-combobox-disabled-item-bug branch July 30, 2024 16:35
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.

Combobox replaces text if you type a disabled value
4 participants