I'm trying this code where formValidator.form.profile.value is a state and getting reset on click of a button.
Current Issue. When i'm trying to select value of comboBox using key board it is setting suggestedDisplayValue. But even if i'm clearing selectedKey to null it is not resetting suggestedDisplayValue and in turn text getting displayed in comboBox
<ComboBox
label="profile?"
onChange={onComboBoxChange}
options={profiles}
required
selectedKey={formValidator.form.profile.value}
/>
It should clearComboBox if selectedKey gets reset
Requested priority: (Blocking, High, Normal, Low) High
Products/sites affected: Yes
Hi @pandey11! Thanks for reporting this. Could you provide a codepen example of this issue you are having? You can start by clicking the "export to codepen" button on this combobox example.
Hi @marygans, I have shared the recording of repro steps over email. Please let me know if needed more info.
@ecraig12345 @marygans any update on this ??
Hi @pandey11 my apologies on the delay here! I was able to view the video and was not able to repro the bug you see on the ms referral site locally. I will share the video repro with my colleagues and get back to you shortly!
I put together a quick codepen and trying to simulate your issue, but so far no luck:
https://codepen.io/micahgodbolt/pen/aeEdEo?editors=0011
While i see there is a suggestedDisplayValue
As soon as I select an option via keyboard, that state is removed. Can you fork this Pen and try to repro your isse?
Hi @micahgodbolt please try this https://codepen.io/anon/pen/XvVaNo?editors=0011
onClick={() => {
if (_basicComboBox.current) {
setKey(null);
// _basicComboBox.current.focus(true);
}
defining callback function inline somehow re-render the and component and cause performance issue.
Repro step:
Ok I see. Repro is even easier. If you open the dropdown and then close it by clicking outside of the dropdown, setting the 'selectedKey' to null does not change the value.
This is creating illusion to user that required field is provided but application blocks user to proceed.it's a high severity issue for our application
@pandey11 our shield devs are balancing a number of incoming issues. We'll take a look into as soon as we can. As an open source project, if you are able to find the offending logic (probably in the onDismiss callback) and create a PR, we'd be happy to review and get it merged ASAP
:tada:This issue was addressed in #10102, which has now been successfully released as [email protected]
.:tada:
Handy links:
@marygans @micahgodbolt i think the latest version is not working properly, can you please try with combobox which have key as string type,it's working with options having key as integer
@marygans @micahgodbolt i think the latest version is not working properly, can you please try with combobox which have key as string type,it's working with options having key as integer
Hi @pandey11, I just tested again and it is working fine for me, can you provide your example?
I'll reopen again until we can determine if there's still an issue here.
@marygans Did the previous fix not fix this issue? If not, is there active work on this?
Hi @pandey11 Below is what I see when I repro'd with strings. Can you share a bit more of your scenario via codepen or similar?
_(React state in DOM now updates here)_
Thanks!
@marygans Can we sync up over team, sometime tomorrow(Redmond time will also work).I am able to repro this in my application but struggling to repro it with codepen.
@pandey11, yeah sure. I will set up some time!
Closing this issue as I spoke with @pandey11 offline a few weeks regarding the issue in product application vs this repo. Feel free to re-open for any further questions
Most helpful comment
I'll reopen again until we can determine if there's still an issue here.