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

Nimble combobox filter not updated on programmatically changing the value. #1266

Closed
saikrishnan-ni opened this issue May 23, 2023 · 3 comments · Fixed by #1270
Closed

Nimble combobox filter not updated on programmatically changing the value. #1266

saikrishnan-ni opened this issue May 23, 2023 · 3 comments · Fixed by #1270
Assignees
Labels
bug Something isn't working client request Client team would immediately benefit from this change

Comments

@saikrishnan-ni
Copy link
Contributor

🐛 Bug Report

The filter for nimble combobox's filtered options stays the same after programmatically changing the combobox's value.

💻 Steps to recreate the behavior

Select an options from the combobox, manually delete a character from the input and select the previous option again.
Now change the combobox's value programmatically, either through devtools console or angular component(using combobox's element reference)
Now when clicked on the combobox it will show the previosly selected value in the below list option

🤔 Expected Behavior

When we change the selected option from the list option either via typing or selecting from the list by clicking and later update it programmatically, it should either display the list options or the selected option when clicked on it.

😯 Current Behavior

When we type something in the dropdown and then select an option from the filtered list, the filter text remains the same even after the combobox value is programmatically changed and when we click back on the combobox it still shows the previously filtered options list which doesn't seems relevant to the selected value. Attached gif below for reference
NimbleComboboxFilter

💁 Possible Solution

The filter could be reset to empty string on changing the combobox's value.

🔦 Context

🌍 Your Environment

  • OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
  • Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
  • Version [e.g. 1.8.0]
@saikrishnan-ni saikrishnan-ni added bug Something isn't working triage New issue that needs to be reviewed labels May 23, 2023
@m-akinc m-akinc added client request Client team would immediately benefit from this change and removed triage New issue that needs to be reviewed labels May 23, 2023
@m-akinc m-akinc self-assigned this May 23, 2023
@atmgrifter00
Copy link
Contributor

I'll note that this is a FAST issue (which I will be filing one against them soon). Unfortunately, this isn't easy to workaround as the filter state that is causing this behavior is private and inaccessible to our implementation. Nor is there a good way for us to override behavior to subvert/alter changes to that private state. At the moment this appears like something that will have to be addressed in FAST directly, which will obviously delay when a fix will be available.

@m-akinc
Copy link
Contributor

m-akinc commented May 24, 2023

It seems like there are a number of inconsistencies with how the combobox sets or clears its filter, e.g. based on whether you open the dropdown with a click or down arrow. I believe @atmgrifter00 will be trying to enumerate some of those problems in the issue he files to FAST. In the meantime, I think we can provide a stop-gap solution by modifying the private filter member like this: this['filter'] = .... It's dirty to have to do that, but it seems worth doing to resolve a problem that clients have no other workaround for.

@atmgrifter00
Copy link
Contributor

I just filed this issue to FAST.

@atmgrifter00 atmgrifter00 changed the title Nimble combobox filter not updated on programatically changing the value. Nimble combobox filter not updated on programmatically changing the value. May 30, 2023
m-akinc added a commit that referenced this issue Jun 1, 2023
## 🤨 Rationale

Fixes #1266 

## 👩‍💻 Implementation

Overrided the `value` property setter to clear the (private) `filter`
field and update filtered/selected items when not being set via typing.

## 🧪 Testing

Manual testing in Storybook plus a new unit test.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: Milan Raj <rajsite@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client request Client team would immediately benefit from this change
Projects
Development

Successfully merging a pull request may close this issue.

3 participants